More reorganizing. Replaced 'hooks' by EventEmitter-objects.