Added an object to store pending promises

As promises can not be persisted to localStorage, we need to store them into a in memory object.