docs: function registerWidget(name, constructor) {
    if (typeof name !== 'string' ||
      typeof constructor !== 'function' ||
      typeof constructor.getTemplate !== 'function' ||
      constructor.prototype.type !== 'Widget') {
      throw 'Invalid arguments passed for registerWidget';
    }
    widgets[name] = constructor;
  }