Kick-ass JavaScript finite state machines