A finite state machine javascript micro framework