Implement MasterElection

Hmm, that's where it was meant to be (see the header ordering) :)
Moved.