A simple control flow function for JavaScript promises, similar to creationix/step