 			set: (value) -> @_setPropertyValue(name, value)
 
 	@proxyProperty = (keyPath, options={}) ->
+
 		# Allows to easily proxy properties from an instance object
 		# Object property is in the form of "object.property"
+		
 		objectKey = keyPath.split(".")[0]
-		return _.extend options,
+		
+		descriptor = _.extend options,
 			get: ->
 				return unless _.isObject(@[objectKey])
 				Utils.getValueForKeyPath(@, keyPath)
 			set: (value) ->
 				return unless _.isObject(@[objectKey])
 				Utils.setValueForKeyPath(@, keyPath, value)
+			proxy: true
 
 	_setPropertyValue: (k, v) =>
 		@[DefinedPropertiesValuesKey][k] = v


	@define = (propertyName, descriptor) ->

		for i in ["enumerable", "exportable", "importable"]
			if descriptor.hasOwnProperty(i)
				throw Error("woops #{propertyName} #{descriptor[i]}") if not _.isBoolean(descriptor[i])

		# See if we need to add this property to the internal properties class
		if @ isnt BaseClass
			descriptor.propertyName = propertyName

			# Have the following flags set to true when undefined:
			descriptor.enumerable ?= true
			descriptor.exportable ?= true
			descriptor.importable ?= true

			# Toggle importable to false when there's no setter defined:
			descriptor.importable = descriptor.importable and descriptor.set

			# Only retain options that are importable, exportable or both:
			if descriptor.exportable or descriptor.importable
				@[DefinedPropertiesKey] ?= {}
				@[DefinedPropertiesKey][propertyName] = descriptor

		# Set the getter/setter as setProperty on this object so we can access and override it easily
		getName = "get#{capitalizeFirstLetter(propertyName)}"

			@::[setName] = descriptor.set
			descriptor.set = @::[setName]

		# Better readonly errors for debugging

		# else
		# 	descriptor.set = (value) -> 
		# 		throw Error("#{@constructor.name}.#{propertyName} is readonly")

		# Define the property
		Object.defineProperty(@prototype, propertyName, descriptor)

	@_addDescriptor: (propertyName, descriptor) ->

		# for key in ["enumerable", "exportable", "importable"]
		# 	if descriptor.hasOwnProperty(key)
		# 		throw Error("woops #{propertyName} #{descriptor[key]}") if not _.isBoolean(descriptor[key])

		descriptor.propertyName = propertyName

		# Have the following flags set to true when undefined:
		descriptor.enumerable ?= true
		descriptor.exportable ?= true
		descriptor.importable ?= true

		# We assume we don't import if there is no setter, because we can't
		descriptor.importable = descriptor.importable and descriptor.set
		# We also assume we don't export if there is no setter, because 
		# it is likely a calculated property, and we can't set it.
		descriptor.exportable = descriptor.exportable and descriptor.set

		# We assume that every property with an underscore is private
		return if _.startsWith(propertyName, "_")

		# Only retain options that are importable, exportable or both:
		if descriptor.exportable or descriptor.importable
			@[DefinedPropertiesKey] ?= {}
			@[DefinedPropertiesKey][propertyName] = descriptor

			# Set the order, insert it's dependants before, we'll check if they exist later
			@[DefinedPropertiesOrderKey] ?= []

			if descriptor.depends
				for depend in descriptor.depends
					if depend not in @[DefinedPropertiesOrderKey]
						@[DefinedPropertiesOrderKey].push(depend)
			
			@[DefinedPropertiesOrderKey].push(propertyName)

	@simpleProperty = (name, fallback, options={}) ->
		return _.extend options,
