Add support for events for better plugin management

Add support for events for better plugin management