WIP: Add a utility for doing master election via etcd.

Sending this for comment, will work on unit tests once people are happy with the code.
Also worth considering that the implementation doesn't need to be a public object.