Handle events in maps a lot more nicely.

This will register and de-register maps classes as they are loaded or
unloaded.