StateQuery - finite state automata implementation in javascript