Add support for global event handlers

Add the template foo required to define global event handlers.
Merge pull request #19 from scottso/global_event_handler_support

Add support for global event handlers