 
     null
 
+  # Map molo function
   root.molo = moloFunc
+
+  # Set path configuration
+  root.molo.basePath = ''
   root.molo.paths = {}
+
+  # Completely clear all caches
   root.molo.clear = ->
     cache = {}
     queue = {}
 
+  # Delete a single module from cache, which forces it to
+  # reload this module if it comes up as a dependency the
+  # next time
   root.molo.delete = (name) ->
     delete cache[name] if cache[name]
     delete queue[name] if queue[name]

      require: deps, 
      define: defines

  root.define.amd =
    jQuery: true
# ES 5 compability functions
Object.keys or= (o) -> name for own name of o
Array.isArray or= (a) -> a.push is Array.prototype.push and a.length?

# CommonJS flag
isCommonJS = exports?

# Function to check for JavaScript file ending
hasExtension = (filename, extension) -> 
  return undefined unless filename?
  
  filename.lastIndexOf(extension) is filename.length - extension

isJavaScriptFile = (filename) -> hasExtension filename, '.js'

# Wrapper function
do (root = exports ? this) ->
  cache = {}
  queue = {}
  pathSep = '/'

  moloFunc = (name, defines) ->
    # Skip flag to skip the rest of the function
    skipFunc = false

    # If name is not a string, it's an anonymous module (Put defines parameter in the correct order)
    if typeof name isnt 'string'
      # If name is an array, just load dependencies
      if Array.isArray(name) 
        defines =
          require: name

        skipFunc = true
      else 
        [name, defines] = [undefined, name]

    # Get properties from defines if it's an object, else they are no dependencies and take the function as the factory
    if typeof defines is 'function' then define = defines else {define, require: deps, context} = defines
