   Pool.run('track', hull)
 
   # Execute Hull.init callback
-  readyDfd.resolve {hull, me, app, org}
+  ready.resolve {hull, me, app, org}
 
   EventBus.emit('hull.ready', hull, me, app, org)
   EventBus.emit('hull.init', hull, me, app, org)

# Wraps init failure
onInitFailure = (err)-> throw err

#Main Hull Entry Point
init = (config={}, userSuccessCallback, userFailureCallback)->
  if !!hull._initialized
    throw new Error('Hull.init can be called only once')


require './utils/console-shim'


###*
 * Wraps the success callback
 * 
 * Extends the global object
 * Reinjects events in the live app from the pool
 * Replays the track events
 * @param  {function} userSuccessCallback the function that will be called if everything went well
 * @param  {object} _hull               an partial build of the Hull object
 * @param  {object} data                config data coming from the Remote
 * @return {object}                     the Hull object
###
onInitSuccess = (userSuccessCallback, hull, data)->
  userSuccessCallback = userSuccessCallback || ->
  {me, app, org} = data

  embeds.initialize({ org });
