More type safety for transitions plus updates to support events.
Merge pull request #219 from MrBigDog2U/master

state-machine updates