Fixed up code for readability based on Paul's comments.
Replaced all event type codes with human-parsable methods in Event.