* Improve event handler to only run events that have been registered * Tidy up events into their own function files