State automaton (finite state machine, fsm) JavaScript library