Implement MasterElection

The wrapping broke early here.