Warning: massive spoilers ahead:
In the first and only time we actually see Mordred, we learn that A: He can summon elephants larger than castles, and B: He's connected to Vortigern. The first time we see Vortigern, the first thing he does is try to protect his brother by begging him not to fight, and then acknowledge his relationship to Mordred by saying "I know him. He will accept surrender."
Then, just before Uther kills Mordred after a pitiful defense, we see Vortigern's nose bleed, a typical sign of someone's brain being effected by some outside force.
After the battle, we find that Vortigern has been rounding up and killing off the other Mages (something Mordred might do to ensure there is no one left to challenge him.) We know this is uncharacteristic of him because Uther calls him out on it when he tells Vortigern's wife: "He is not himself today."
Then we have Vortigern building a tower identical to Mordred's, explicitly stated so he could have power equal to what Mordred's had.
My theory is that at some point when Vortigern was meeting with the Mages prior to the movie, he was offered a deal by Mordred after he (Mordred) learned of Excalibur being tied to the Pendragon line: Ultimate power in exchange for a shared body. That way, he could gain control over Excalibur by circumventing its requirement. Thus, his attack on Camelot was nothing but a diversion. He intended to 'die,' giving Uther the illusion that he has defeated his foe (leaving him off guard) and ensuring he had the power of the one weapon capable of besting him. Of course, Vortigern had no idea what the real cost would be, as Mordred was forced to strike a deal with the Sirens to give his new and un-prepared-for-magic body the power it needed to kill Uther, his wife, and the child Arthur. At that point, Vortigern may have accepted the death as an acceptable loss. However, when the Mordred-controlled-Vortigern was then forced to kill his daughter as well, something of Vortigern may have finally broken free in the moments after the act.
The mage is never named or credited within the movie, simply referred to as "the Mage". Apparently the character was originally supposed to be Guinevere, but was changed to avoid the a cookie-cutter romance.
Instead - the Mage is the one and only original sorcerer supreme - Merlin himself. Merlin would easily be capable of the stupendous feats of magic, and "The Mage" fits the traditional role of Merlin's role in the story. We know the sword was forged by Merlin, but we never see his face.
As for the sex change - well, we don't know if Merlin was always a woman in this universe, or they changed their gender to better hide during the 20 years of Vortigen's reign.