Implement MasterElection

What's the scope for here? A former ```unique_lock```?