 
     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
    # Get the result of cached dependencies
    cacheDeps = []

    for i in deps
      if cache[i]
        cacheDeps.push cache[i]
      else
        unless isCommonJS
          # Create script element
          scriptElem = root.document.createElement 'script'
          scriptElem.async = true

          if isJavaScriptFile(root.molo.paths[name])
            # If the path is complete (e.g. 'js/lib/mymodule.js') take that as a path
            scriptPath = root.molo.paths[name]
          else
            # Prepend the base path if any
            prePath = if root.molo.basePath then "#{basePath}" else ''
            pathArray = Object.keys(root.molo.paths)

            # Walk through all paths and check if the module name starts with the path name
            for p in pathArray
              if root.molo.paths[p] and name.indexOf("#{root.molo.paths[p]}#{pathSep}") is 0
                prePath = root.molo.paths[p]

            scriptPath = if prePath then "#{prePath}#{pathSep}#{i}.js" else "#{i}.js"

          scriptElem.src = scriptPath

          # Append script element to the head of the page
          root.document.head.appendChild scriptElem

        # Add script definition to queue
        queue[name] = defines

        # Set skip flag
