Change registry to be an emitter.

Why not emit events when all components are removed? (one event per component)