Utilities for iterating through arrays using promises