Add event system based on node-style EventEmitter

 * Replace old 'hooks' system with new EventEmitter