Widgets now support generic callbacks on buttons.
Refactored widget js, does not cause eye cancer anymore.