New API for widgets using a metaclass.

It is now possible to define a default state and to submit extra stylefiles and javascript files when defining a widget in an app.
Review 1
Fix tests.