WIP: Add election framework to master; publish services.

Needs tests still.
I don't know if it's generally useful, but the code pattern looks enough like util.Forever that I just assumed it.