Provides a generic way to cache promises and ensure all are resolved at the appropriate time