events: add execution hooks

This allows developers to hook into key places during the EventEmitter
life cycle.