 					sublist = @parsePartials source
 
 					if sublist.length
-						@_makePartials partials, sublist, root, defaultEngine
-				
+						@_makePartials partials, sublist
 		
-	
-	compile : (source='', options)->
+	render : (source, context={})->  # Shortcut for @compile(source, options)()
+		do @compile source, context
+
+	compile : (source='', options={})->
+		@root = options.root if options.root
+		@ext = options.defaultEngine if options.defaultEngine
+
 		hogan = require 'hogan.js'
 		compiled = hogan.compile source
 

		partial_files = @parsePartials source

		if partial_files.length
			@_makePartials partials, partial_files, options.root, options.defaultEngine

		return ->
			return compiled.render options, partials

	
	__express : (filename, options, callback) ->
		# add support for Express 3.x templating scheme
		# in Express use like this:

		return result

	
	_readFile : (path)->
		{readFileSync} = require 'fs'
		return readFileSync(path).toString() # TODO better way to read file? especially large ones.

	getSourcePath : (file)-> # Get full filepath.
		join @root, file

	getSource : (file)->  # Return source file.
		filepath = @getSourcePath file

		if existsSync filepath
			return @_readFile filepath
		else if @ext and existsSync filepath+=".#{@ext}"
			return @_readFile filepath

		return ''
	
	_makePartials : (partials, list)->
		for file in list
			sublist = []
			source = null

			if file not of partials
				source = @getSource file

				if source
					partials[file] = source
