StateMachine as EventEmitter