Refactor widgets and rework client side

Currently, the code for widgets is very much tied to the Dashboard code, making addition of new widgets complicated. This needs to be changed to a more modular structure to allow easy addition of new widgets. 

In addition to this, the client side code is in a bad state: messy, untested, suboptimal. While this could be made a separate issue, it wouldn't make sense to fit the current client side code to the new 'modular' widget code approach, then completely rework the client side code (this works the other way too). It thus makes more sense to rework the client side code while changing to the 'modular' widget approach.