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.
I think if master == "" it probably makes sense to immediately re-run handleMaster? Or at least there's no reason to wait the entire ttl-- you can imagine running this for things where you want a long lock as well as for things where you want a short lock.