var express = require('express'),
    fs = require('fs'),
    http = require('http'),
    https = require('https'),
    nativeMongoConnection = require('./lib/native-mongo-connection'),
    nconf = require('nconf'),
    passport = require('passport'),
    server = express(),
    utils = require('./lib/utils'),
    winston = require('winston');

module.exports = function(testing) {

    if (testing === undefined || typeof testing !== 'boolean') {
      testing = false;
    }

    /**
     * Use these functions to retrieve the
     * appropriate database connection. This
     * step ensures that the gebo establishes
     * the correct connection to the database
     * (i.e., testing or production)
     */
    nativeMongoConnection.get(testing, function(){}); 
    exports.nativeMongoConnection = nativeMongoConnection;
    exports.mongoose = require('gebo-mongoose-connection').get(testing);

    /**
     * Load gebo configurations
     */
    nconf.file({ file: './gebo.json' });

    /**
     * Load passport configuration,
     * standard gebo routes, and basic 
     * actions
     */
    var pass = require('./config/pass'),
        basic_routes = require('./routes/basic'),
        message_routes = require('./routes/message'),
        perform_route = require('./routes/perform')(),
        oauth2_routes = require('./routes/oauth2')(),
        user_routes = require('./routes/user')();
    
    /**
     * Expose the necessary modules 
     */   
    exports.actions = require('./actions')(); 
    exports.schemata = require('./schemata');
    exports.server = server;
    exports.utils = utils;
    
    /**
     * Winston Logger
     */
    var logger = new (winston.Logger)({ transports: [ new (winston.transports.Console)({ colorize: true }) ] });

    /**
     * Apply settings
     */
    require('./config/settings')(server, express, passport, logger);

    /**
     * Basic routes
     */
    server.get('/', basic_routes.index);

    /**
     * Authenticated user routes
     */
    server.get('/account', user_routes.account);
    server.get('/login', user_routes.getLogin);
    server.post('/login', user_routes.postLogin);
    server.get('/admin', user_routes.admin);
    server.get('/logout', user_routes.logout);
    server.post('/signup', user_routes.signUp);

    /**
     * OAuth2 routes
     */
    server.get('/dialog/authorize', oauth2_routes.authorization); 
    server.post('/dialog/authorize/decision', oauth2_routes.decision); 
    server.post('/oauth/token', oauth2_routes.token);
    server.get('/verify', oauth2_routes.verify);

    /**
     * Perform route
     */
    server.post('/perform', perform_route.perform);

    /**
     * Message routes
     */
    server.post('/send', message_routes.send);
    server.post('/receive', message_routes.receive);

    /**
     * Enable behaviour defined in action module
     *
     * @param object
     */
    exports.enable = function(actionModule) {
        if (actionModule.actions) {
          console.log('here');
          exports.actions.add(actionModule.actions); 
        }
        if (actionModule.schemata) {
          exports.schemata.add(actionModule.schemata);
        }
      };

    /**
     * Start the gebo servers
     */
    exports.start = function() {
        // HTTP
        logger.info('HTTP listening on', nconf.get('port'));
        http.createServer(server).listen(nconf.get('port'));
        
        // HTTPS
        var options = {
            key: fs.readFileSync('./cert/key.pem'),
            cert: fs.readFileSync('./cert/cert.pem'),
        };
        
        logger.info('HTTPS listening on', nconf.get('httpsPort'));

        https.createServer(options, server).listen(nconf.get('httpsPort'));
      };

    return exports;
}

@@ -2858,16 +2858,60 @@
 %0A     *%0A
+     * @param string - a unique module name%0A
      * @
@@ -2961,16 +2961,28 @@
 unction(
+moduleName, 
 actionMo
@@ -2985,24 +2985,47 @@
 onModule) %7B%0A
+        // Add actions%0A
         if (
@@ -3062,39 +3062,309 @@
     
-console.log('here');%0A          
+var keys = Object.keys(actionModule.actions);%0A          if (keys.length %3E 0) %7B %0A            exports.actions%5BmoduleName%5D = %7B%7D;%0A            for (var i = 0; i %3C keys.length; i++) %7B%0A              exports.actions%5BmoduleName%5D%5Bkeys%5Bi%5D%5D = actionModule.actions%5Bkeys%5Bi%5D%5D; %0A            %7D%0A          %7D%0A          //
 expo
@@ -3405,32 +3405,55 @@
 ns); %0A        %7D%0A
+        // Add modules%0A
         if (acti
@@ -3500,24 +3500,36 @@
 chemata.add(
+moduleName, 
 actionModule

Add actions to inner property to avoid name clashes