     engine.registerPartial(tplName, compiled)
     compiled
 
-  # Handles the various priorities and locations of templates 
+  # Handles the various priorities and locations of templates
   _getTemplateDefinition = (name, ref, widgetName, dom)->
     path = "#{ref}/#{name}"
     tplName = [widgetName, name.replace(/^_/, '')].join("/")

define ['lib/hullbase', 'handlebars'], (Hull, Handlebars) ->

  #Compiles the template depending on its definition
  setupTemplate = (tplSrc, tplName) ->
    engine = module.templateEngine 
    tplName = tplName.replace(/\//g,'.',)
    if (_.isFunction(tplSrc))
      compiled = engine.template tplSrc

    module.define path, parsed
    parsed

  module =
    global: window
    require: require
    define: define
    templateEngine: Handlebars
    getTemplateDefinition: _getTemplateDefinition
    initialize: (app) ->
      app.core.template.load = (names=[], ref, format="hbs") ->
        undefinedTemplates = []
