Moved out transition logic from State objects.

New class Transition now has the the transition logic.  State objects
modified to make this change.  This eliminated duplication and made the
State objects do just 1 thing.