Allow widget views to be loaded from require modules

This required refactoring things that create widget views to use
callbacks instead of return values.
Make changes suggested by @jdfreder
Fix logic
Put callbacks for create_view and create_child_view in options

And add errback support
Clean up some JS code
Remove superfluous error checking
Merge pull request #6494 from takluyver/widget-comm-require

Allow widget views to be loaded from require modules