 
 
 # Globals
-window.define = AutoexecBat.define
-window.require= AutoexecBat.require
-window.Namespace= AutoexecBat.namespace
+root.AutoexecBat = AutoexecBat
+root.define      = AutoexecBat.define
+root.require     = AutoexecBat.require
+root.namespace   = AutoexecBat.namespace
 
 # Plugins
 unless typeof jQuery is 'undefined'

        block = arg

    block ?= -> # empty function
    top    = AutoexecBat.topLevel #window
    target = AutoexecBat.namespace name

    target.name     = name

    ns = ns.split "." if typeof ns is "string"
    ns.unshift AutoexecBat.topLevel unless ns[0] == AutoexecBat.topLevel

    module = root
    for item in ns
      module = module[item] unless typeof module[item] is 'undefined'
    module
