Utility for working with an array of promises