module.exports = function (pkg, id) {
  if (typeof pkg === 'object' && pkg.nimoy && pkg.html) {
    var template = {
      toString : function () {
        return pkg.html
      },
      get : function (selector) {
        var div = document.createElement('div')
        div.innerHTML = pkg.html
        var part = div.querySelector(selector)
        div = document.createElement('div')
        div.appendChild(part)
        return div.innerHTML
      }
    }

    var mod = (pkg.nimoy.defaultData) 
      ? require(pkg.name)(id, template, pkg.nimoy.defaultData)
      : require(pkg.name)(id, template)

    mod.id = id
    return mod
  } else return false
}

module.exports = function (pkg, id) {
  if (typeof pkg === 'object' && pkg.nimoy && pkg.html) {
    var template = {
      toString : function () {
        return pkg.html
      },
      get : function (selector) {
        var div = document.createElement('div')
        div.innerHTML = pkg.html
        var part = div.querySelector(selector)
        div = document.createElement('div')
        div.appendChild(part)
        return div.innerHTML
      }
    }

    var mod = (pkg.nimoy.data) 
      ? require(pkg.name)(id, template, pkg.nimoy.data)
      : require(pkg.name)(id, template)

    mod.id = id
    return mod
  } else return false
}

use new style templates