Transition listeners now have stages

Fixes #59 

A transition listener is now notified before, between, and after the
state transition.  The specific stage is passed to the transition
listener so that it can decide when to react.