Added support for custom events to be provided by plugins.