Mayor election with tests.

There is a problem: when a new mayor is elected, the old one is used
for the stake vote.