widgets: don't explode if the tree is empty
Add basic tests

To see if the widget loads and there's js in the rendered output.

Fixes #3