implement a leader election algorithm that finds the best history in a quorum

Right now we randomly pick a leader.