Add promises to the widget framework.

Parallel to @jasongrout 's solution (human race condition).
Probably worth leaving a comment to mention that this now returns a promise.