Refactored event handler discovery.
Implemented event handler priorities (closes #34).