I loved it.
Honestly, for the past few episodes, I had it set in my head that Irene was either working for Moriarty or being forced to work for him and manipulate Holmes. When she turned up in NY, I knew she wasn't genuinely the lost and tortured soul she was pretending to be. I figured her whole "death" was a ploy used by Moriarty to devastate Holmes and get him out of London. But when she revealed herself as Moriarty, I thought it was brilliant and something no one saw coming.
Who cares if M is a woman? The game between M and Sherlock has never been about gender, or two "alpha males" clashing. It's a battle of minds. A game of wits. All that matters is that Moriarty is Holmes' intellectual equal. The idea of M passing herself off as Irene to get close to him and study him is exactly something that Sherlock would do to catch a criminal. They are obsessed with their work, ruthless in their pursuit of the truth, and often insensitive to the human condition. Elementary's M served the same purpose as any M interpretation has -- a master criminal with genius-level intellect (like Holmes), who had a large network of agents working on her behalf; someone who gave Sherlock Holmes a run for his money.
I commend this show for its advanced planning and for keeping this a secret for so long. I also can't wait to see Moriarty pop up again in the future. You know she's going to orchestrate a brilliant escape from prison...