Recursively resolve any promises in an object to form a JSON structure