Try to fix qsort logic
Keep a map of (provider,item):amount in tree for getAllPromissesFor
node addPromise adds to it, remove has to recursively remove all promises contained in the removed subtree