Externalize event registry.

Adds functionality to add custom events via external plugin.