Utility functions for working with Promises in Node