JavaScript widgets system base. Buttons are now loaded from JavaScript

JavaScript widgets system base. Buttons are now loaded from JavaScript directly, and new widgets can be added with widgets.addWidget()

This is the first part of a major redesign in the widget loading system, making it far more modular and flexible, with a minimal impact on performance.... hopefully.