Finite State Machines in javascript