A finite-state machine router for building complex, asynchronous processes in Node.js