An easy to write statemachine for nodejs