Implement MasterElection

This enum is only used in the private section, I'd move it there (presumably, any test that would poke at variables of that type would be friend already?).