Promise-based asynchronous Finite State Machine for node/browserify