-window.AutoexecBat =
+root = exports ? window
+
+AutoexecBat =
   topLevel: "App"
   debug: true
-  autoRequire: null
+  # autoRequire: null
         
   log: (msg) ->
     console?.log msg if AutoexecBat.debug

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

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

    (AutoexecBat.initializeModule(lib) for lib in dependencies) if dependencies

  namespace: (name) ->
    target = root
    target = target[item] or= {} for item in name.split '.'
    target

