Fixed some issues with EventsController

Also, added more functionality to it. The asynchronous behavior of
javascript means that EventsController will probably need to be
rewritten as all the issues I'm having are due to that. I would fix it
but I don't have a clue how to. If anybody does, feel free to work on
it.