code: function addPlugin(inst) {
    var name = inst.name
      , data = inst.data
      , dom = inst.domain;
  
    if (!name) {
      error('plugin has an bad/undefined name key');
    }
  
    if (type.isFunction(data)) {
      var dataval = data();
      if (!dataval) {
        error('plugin ' + name + 'returned bad value from its defined data method ' + dataval);
      }
      (new Data()).add(name, dataval);
    }
  
    if (type.isFunction(dom)) {
      var domval = dom();
      if (!type.isString(domval)) {
        error('plugin "' + name + '" returned bad value from its defined domain method');
      }
      (new Domains()).add(name, path.resolve(domval));
    }
  }
docs: use helper