events: use RegisterUnitEvent to replace our home-brew event dispatcher.
Merge pull request #195 from Adirelle/RegisterUnitEvent

Use RegisterUnitEvent to replace our home-brew event dispatcher.