Move unload() into ObjectRegistry.

Make unload() and reset behave similarily. Both remove objects and
detach events.