Voting overhaul

Finally got round to making a generic vote object. Also fixed numerous
bugs with votes.