support events.
Merge pull request #78 from taptapship/events

initial attempt at event handling.