Allow widgets to be constructed from Javascript

Also fixes a bug in the comm manager.
Both work in this context; however, I changed it to the later since your comment suggests that you prefer I use `delete`.