Implemented StateMachine.copy. Unit tests for it are pending.