Added an event manager
Added support for global event handlers