Implement MasterElection

Might be worth a comment, though.