Use prototypal inheritance to speed up the inheritance of widget variables

Now we reuse the prototype mechanism to let javascript do the work of
searching up the parent chain.
Tweaks tests

This was the only place we were using the `variables` option to the
widget constructor.