var Handlebars = require('handlebars');

function Exbars(options) {
  this.defaultLayout = options.defaultLayout ? options.defaultLayout : null;
  this.handlebars = Handlebars;
  this.compilerOptions = options.compilerOptions ? options.compilerOptions : {};
  this.compiledTemplates = {};

  this.registerHelper = function(name, helper) {
    return this.handlebars.registerHelper(name, helper);
  };

  this.registerPartial = function(name, content) {
    return this.handlebars.registerPartial(name, content);
  };

  this.compile = function(template, content) {
    this.compiledTemplates[template] = this.handlebars.compile(content, this.compilerOptions);
  };

  this.render = function(filePath, options, callback) {
    var template = this.compiledTemplates[filePath];
    return callback(null, template(options));
  };

  this.engine = function() {
    return this.render.bind(this);
  };
}

module.exports = Exbars;

@@ -768,16 +768,326 @@
 ePath%5D;%0A
+    var layout = options.layout === null ? null : options.layout %7C%7C this.defaultLayout;%0A    if(layout) %7B%0A      var layoutTemplate = this.compiledTemplates%5Bprocess.cwd() + '/views/layouts/' + layout + '.hbs'%5D;%0A      options.body = template(options);%0A      return callback(null, layoutTemplate(options));%0A    %7D %0A
     retu

Add layouts support