started restructuring event handling

events are handled by the Events class. it maps events to a function
pointer. it's not working right now, but I'm tired and want to go
upstairs