Make bindings and event registration typesafe.

This makes use of templates to replace REGTYPEs, and also moves the
various gossip event types into their respective classes (e.g.
CREATURE_EVENT_ON_GOSSIP_HELLO).