Adds a lot of the logic to actually perform the elections. There are some things that need to happen still in TODOs in the code, but that list is not exhaustive.