code: function _addLibrary(app, item) {
    if (!item.name || item.name === '') {
      try {
        if (typeof item.fn.publicName === 'string') item.name = item.fn.publicName;
      } catch (e) {
      }
    }
    item.name = item.name.trim();
    if (item.name.indexOf('thorin-lib-') === 0) {
      item.name = item.name.substr(11);
    }
    if (typeof app[libraries][item.name] !== 'undefined') {
      throw new Error('Thorin.addLibrary: library ' + item.name + " is already registered. Please use a different name.");
    }
    /* Check if we have a constructor or an already created object. */
    let libType = Object.prototype.toString.call(item.fn);
    let itemObj;
    if (libType === '[object Object]') {
      itemObj = item.fn;
    } else {
      itemObj = new item.fn(app);
    }
    app[libraries][item.name] = itemObj;
  }
docs: /*
  Registers a new library.
  // TODO: handle init() and run() if the app is already