Add promises to the widget framework.

Parallel to @jasongrout 's solution (human race condition).
I'd feel more comfortable if this was an explicit check for undefined.