Implement MasterElection

Nice idea, done