 
 init = ->
 
-  funcsToApply = {}
+  mixedIn = {}
 
   Z = (obj) ->
     resolvedObject = resolveCompletely(obj)


  Z.mixin = tools.proc (hash) ->
    tools.pairs(hash).forEach ([name, func]) ->
      funcsToApply[name] = func

  Z


    resultingPromise = tools.objectCreate(overrideLayer)

    overrides.forEach (name) ->
      overrideLayer[name] = (args...) ->
        Z resolvedObject[name].apply(this, args)

    tools.pairs(mixedIn).forEach ([name, func]) ->
      resultingPromise[name] = (args...) ->
        Z resultingPromise.then (resolved) ->
          func.apply({ value: resolved }, args)
