simple JS statemachine