Added getState() and inState() member functions to statemachine class.