Control flow library for chaining shell commands using promises