Function to take a data structure with promises and resolve them all.

By the time this function returns there should be no promises left in
the data structure at all, as long as the data structure fits within the
constraints we impose. (only sequences, mappings and objects that
respond nicely to dir().)