Allow widgets to be constructed from Javascript

Also fixes a bug in the comm manager.
This is failing the tests on Python 3, because `.values()` returns an unordered view. You have a couple of options: `list(Widget.widgets.values())[0]`, or `next(iter(Widget.widgets.values()))`.