Implement MasterElection

For readability, I'd move that to be right after ```CreateProposal()```, so you can go from one to the next.