Make handler object in EventPair optional.

Switched to using scoped pointer to clean up container and handler.
Expose runtime and object factory.
Allow firing events without data argument.
Support firing custom events.
Fix firing custom events on modules.