Add promises to the widget framework.

Parallel to @jasongrout 's solution (human race condition).
I think this should be named more clearly - `resolve_promises_dict`?