 					proto[definition.key] = proto[definition.key] || _.UUID.v4()
 
 					# Set a bunch of default values, so they're all available.
-					_.each(definition.properties, (property, name) ->
+					for name, property of definition.properties
 						# Use the value provided to the constructor, or the default.
 						def = proto[name] || _default(property.type)
 						self[name](def)
-					)
 
 					# Attach a privileged copy of the full id, more for debugging than use.
-					this._id = this.id(true)
+					@_id = @id(true)
 
 					# Add runtime methods
-					_.extend(this.prototype, proto.prototype)
+					_.extend @prototype, proto.prototype
 
 					# Set a few event handlers
 					# Manage accounting after an entity has been persisted
-					_.on(this, 'persisted', () ->
-						this._new = false
-						this._modified = {
+					_.on @, 'persisted', () ->
+						@_new = false
+						@_modified = {
 							_count: 0
 						}
-						ec._modified.remove(this)
-					)
+						ec._modified.remove(@)
 					@
 
 				#Set up the prototype for any of this entity.
 				_build_prototype(name, definition, (protos && protos[name]))
-			)
 
 			ready.resolve()
 
 		# Set up all the required methods - id(), _type(), and the mutaccs.
-		_build_prototype = (name, definition, proto) ->
-			ec = self
-
-			_.extend(definition.Constructor.prototype,
+		_build_prototype = (name, definition, proto) =>
+			_.extend definition.Constructor.prototype,
 				# Get this entity's type. Use the closure'd reference.
 				_type: (full) ->
 					full = full || false

			spec = (spec instanceof Array) ? spec : [spec]
			d = _.Deferred()

			this.get(spec).then((data, meta) ->
				_type = spec._type instanceof Function && spec._type() || spec._type
				d.resolve(data[_type].pop(), meta)
			)


		# Takes a "raw" context object and orders it into the internal _context
		# storage.  Also builds constructors and prototypes for the context.
		_set_context = (context, protos) =>
			# Save the attributes
			_.extend ec._context.attributes, context.attributes

			# Prepare each entity. Uses _.each to put (definition, name) in a closure.
			_.each context.entities, (definition, name) ->
				# Keep the definition locally, modifying it directly with the ctor and prototypes.
				ec._context.entities[name] = definition
				# Ready the instances bucket
