'use strict';

var Container = require('./src/Chromabits/Container/Container'),
    Wrap = require('./src/Chromabits/Container/Wrap'),
    ClassMap = require('./src/Chromabits/Mapper/ClassMap.js'),
    EnclosureClassMap = require('./src/Chromabits/Mapper/EnclosureClassMap.js'),
    DirectoryMapper = require('./src/Chromabits/Mapper/DirectoryMapper.js');

module.exports = {
    // Keep backwards compatibility
    Container: Container,
    Wrap: Wrap,

    bootstrap: function () {
        return this.bootstrapTo(global);
    },

    bootstrapTo: function (target) {
        target.use = EnclosureClassMap.get.bind(EnclosureClassMap);

        return this;
    },

    // Use a more namespace-ish object for everything else
    Chromabits: {
        Container: {
            Application: require('./src/Chromabits/Container/Application.js'),
            Container: Container,
            ServiceProvider:
                require('./src/Chromabits/Container/ServiceProvider.js'),
            Wrap: Wrap
        },
        Loader: {
            Exceptions: {
                ClassNotFoundException: require(
                    './src/Chromabits/Loader' +
                    '/Exceptions/ClassNotFoundException.js'
                )
            },
            ClassPath: require('./src/Chromabits/Loader/ClassPath.js'),
            Loader: require('./src/Chromabits/Loader/Loader.js')
        },
        Mapper: {
            AbstractMapper:
                require('./src/Chromabits/Mapper/AbstractMapper.js'),
            ClassMap: require('./src/Chromabits/Mapper/ClassMap.js'),
            DirectoryMapper:
                require('./src/Chromabits/Mapper/DirectoryMapper.js'),
            EnclosureClassMap:
                require('./src/Chromabits/Mapper/EnclosureClassMap.js')
        }
    }
};

@@ -187,24 +187,83 @@
 ssMap.js'),%0A
+    Loader = require('./src/Chromabits/Loader/Loader.js'),%0A
     Enclosur
@@ -634,65 +634,121 @@
     
-target.use = EnclosureClassMap.get.bind(EnclosureClassMap
+var loader = new Loader();%0A%0A        loader.addMap(EnclosureClassMap);%0A        target.use = loader.get.bind(loader
 );%0A%0A
@@ -1454,52 +1454,14 @@
 er: 
-require('./src/Chromabits/Loader/Loader.js')
+Loader
 %0A   

Use a loader instead for better class name parsing