 # For all details and documentation:
 # http://jefri.org
 
-((($) ->
+do ($ = jQuery) ->
 	$.fn.merge = (doms) ->
 		doms.filter("[id]").each (i, dom) =>
 			dom = $(dom)
 			id = dom.attr("id")
 			child = this.children("#" + id)
 			if child.length is 0
-				this.append(dom)
+				@append(dom)
 			else
 				child.merge(dom.children())
-			null
 		rest = doms.filter(":not([id])")
 		#[id]s handled, replace kids
 		if rest.length
-			this.children(":not([id])").remove()
-			this.append(rest)
-		this
-).call(this, jQuery))
+			@children(":not([id])").remove()
+			@append(rest)
+		@
 
-(((_, $, JEFRi)->
+do (_=_, $ = jQuery || null, JEFRi = JEFRi) ->
 	# Need to make some different assumptions about Templating
-	_.templateSettings = {
+	_.templateSettings =
 		escape: /{{-([\s\S]+?)}}/g,
 		evaluate: /{{([\s\S]+?)}}/g,
 		interpolate: /{{=([\s\S]+?)}}/g
-	}
 
 	# Global Binding settings.
-	settings = {
-		paths : {
+	settings =
+		paths: 
 			root: "JEFRi"
 			theme: '_default_theme'
-		}
-	}
 
 	# Detached DOM node to hold templates.
 	template = $()

		else
			render.page(thing)

	_.extend(render, {
		page: (page) ->
			find(".._page")


				return rel
			else
				return render.entity(entity[rel_name]())

	do () ->
		key = {}

		lock = (entity) ->
