Turned the mongoose registry into an event emitter so events can be registered.