Added State formatting code
Refactored concrete State model into StateMachineImpl
Added logging, state transitions, and more tests