docs: function Application(domain, path) {
     
     // Late instantiation. This is to make sure
     // the app singleton is created and referenced by others
     // before the object is properly instantiated.
  
     this.IPC_TOKEN = IPC_TOKEN;
  
     this.loadSelf = function() {
       
      app = this;
  
      this.inflect = protos.inflect;
  
      var self = this;
      
      // Set environment
      Object.defineProperty(this, 'environment', {
        value: protos.environment,
        writable: false,
        enumerable: true,
        configurable: false
      });
       
      // Cluster object
      this.cluster = cluster;
  
      // Application's Hostname
      this.hostname = domain;
  
      // Domain that will be used to generate cookies, instead
      // of the original application's domain name.
      this.cookieDomain = null;
  
      // Path where the application is located
      this.path = path;
  
      // Application's Classname
      this.className = this.constructor.name;
  
      // Boolean value indicating whether or not the application has initialized
      this.initialized = false;
  
      // Directory to store the models, views, controllers & helpers
      // Defaults to skeleton root. Must start/end with a slash.
      this.mvcpath = path + '/app/';
  
      // Application's API. Groups methods related to the application.
      // The API object gets its methods from the files in the api/ directory.
      this.api = {};
  
      // Application paths. These define where the several application files be stored
      // within the application directory structure.
      this.paths = {
        api: 'api/',
        data: 'data/',
        layout: '__layout/',
        restricted: '__restricted/',
        static: '__static/',
        public: 'public/',
        upload: 'upload/',
        environment: 'env/',
        extensions: 'ext/',
        templates: 'templates/'
      }
  
      /*
        Contains the view data for the application
  
        static: Static view paths
        buffers: Template sources
        callbacks: Rendered template functions
        partials: Rendered template partials
      */  
  
      this.views = {
        static: [],
        buffers: {},
        callbacks: {},
        partials: {}
      }
  
      // If set to true, the application will print log messages on stdout.
      this.logging = true;
  
      // If set to true, the application will print debug messages on stdout.
      this.debugLog = protos.config.bootstrap.debugLog ? true : false;
  
      // If set to true, the application will cache the rendered views, to optimize performance.
      this.viewCaching = false;
  
      // Login URL to use when redirecting unauthenticated users.
      this.loginUrl = '/login';
  
      // Debug color to use on the console
      this.debugColor = protos.config.bootstrap.debugColor || '0;37';
  
      // Application templates
      this.templates = {};
  
      // Application hooks. Callbacks to run on specific events
      this.hooks = {};
  
      // Driver instances
      this.drivers = {};
  
      // Storage instances
      this.storages = {};
  
      // Helper instances
      this.helpers = {};
  
      // Controller instances
      this.controllers = {};
  
      // Controller handlers
      this.handlers = {};
  
      // Model method aliases
      this.model = {}; // Contains model method aliases
  
      // Model instances
      this.models = {}; // Contains model instances
  
      // Engine instances
      this.engines = {};
      
      this.noop = protos.noop;
  
      this.defaultEngine = null;
  
      this.loadedEngines = [];
  
      this.config = {};
  
      this.locals = {};
  
      this.routes = {};
  
      this.httpMethods = protos.httpMethods;
  
      this.httpStatusCodes = http.STATUS_CODES;
  
      // Stores booleans with middleware support/availability information.
      // This property is manipulated by middleware.
  
      this.supports = {};
  
      // To be used by middleware to store objects
      this.resources = {};
  
      // Store filters
      this.__filters = {};
  
      // Store data
      this.__data = {};
  
      /*
        Execution state for tasks. Keys represent the
        task ID's and their respective values are booleans.
  
        The boolean values will determine if the task's
        callback will be executed (when the task's state
        is checked on a specific iteration)
      */
  
      this.__jobExecutionState = {};
  
      // Task Interval IDs. Can be passed to clearInterval to
      // disable the tasks permanently.
  
      this.__jobIntervalIDs = {};
  
      // Object containing each of the invalidation callbacks for each cache key
      this.__jobInvalidationCallbacks = {};
  
      /////////////////////////////
  
      // Attach configuration
      this.config = parseConfig.call(this);
  
      // Verify that regexes are valid
  
      if (!this.config.regex) this.config.regex = {};
  
      for (var r in this.config.regex) {
  
        if (r in protos.regex) {
          this.debug("Warning: regex has been overridden: %s", r);
        }
  
        var re = this.config.regex[r].toString();
  
        if (!protos.regex.validRegex.test(re)) {
          throw new Error(util.format("\
  Bad regular expression in app.config.regex, where %s => %s\n\n\
  %s\n", r, re, protos.i18n.badRegularExpression));
        }
  
      }
  
      /////////////////////////////
  
      this.regex = _.extend(this.config.regex, protos.regex);
  
      // Structure application's baseUrl
      
      var portSuffix = protos.config.bootstrap.server.portSuffix;
      var listenPort = protos.config.server.listenPort;
      var securePort = protos.config.bootstrap.server.useSSL ? protos.config.bootstrap.ssl.port : null;
      
      if (portSuffix || portSuffix === undefined) {
        // If portSuffix is undefined it means the boot.js file does not have it defined, therefore
        // it should be assumed as defined, since this is the default behavior.
        var portStr = (listenPort !== 80) ? util.format(':%s', listenPort) : '';
        var securePortStr = (securePort !== 443) ? util.format(':%s', securePort) : '';
      } else {
        portStr = securePortStr = '';
      }
      
      this.baseUrl = util.format('http://%s%s', this.hostname, portStr);
      this.baseUrlSecure = util.format('https://%s%s', this.hostname, securePortStr);
  
      var useSSL = protos.config.useSSL;
      var ssl = protos.config.bootstrap.ssl;
  
      var serverCallback = function(req, res) {
        req.startTime = Date.now();
        self.routeRequest(req, res);
      }
  
      this.server = http.createServer(serverCallback);
  
      if (useSSL && ssl) {
        var sslServerOpts = {
          key: fs.readFileSync(this.fullPath(ssl.key), 'utf8'),
          cert: fs.readFileSync(this.fullPath(ssl.cert), 'utf8')
        }
        this.secureServer = require('https').createServer(sslServerOpts, serverCallback);
      }
  
      // Load protos components
      var componentsCb = (protos.config.bootstrap.events && protos.config.bootstrap.events.components);
      if (componentsCb instanceof Function) {
        componentsCb.call(protos, protos);
      }
  
      // Emit protos bootstrap event
      protos.emit('bootstrap', this);
  
      // Set worker message listener (messages from workers to master)
      // Runs messages formatted as [method, arg1, arg2, ... argn],
      // assuming 'method' is an actual method existing in app
      // This is internal, not intended for use in apps (unless you really know what you're doing)
  
      this.on('worker_message', function(msg) {
        if (msg instanceof Array) {
          var token = msg[0];
          if (token === IPC_TOKEN) {
            var method = msg[1];
            if (app[method] instanceof Function) {
              try {
                app[method].apply(app, msg.slice(2));
              } catch(err) {
                (app.errorLog || app.log)(err);
              }
            }
          }
        }
      });
      
      // Set master message listener (messages from master to workers)
      // Runs messages formatted as [method, arg1, arg2, ... argn],
      // assuming 'method' is an actual method existing in app
      // This is internal, not intended for use in apps (unless you really know what you're doing)
  
      this.on('master_message', function(msg) {
        if (msg instanceof Array) {
          var token = msg[0];
          if (token === IPC_TOKEN) {
            var method = msg[1];
            if (app[method] instanceof Function) {
              try {
                app[method].apply(app, msg.slice(2));
              } catch(err) {
                (app.errorLog || app.log)(err);
              }
            }
          }
        }
      });
      
      // Load data
      loadData.call(this);
  
      // Load hooks
      loadHooks.call(this);
      
      // Emit env data hook
      this.emit('env_data_loaded', protos.__envData);
      
      // Emit app's pre_init event (needs to be called after loading hooks)
      // to be able to use hooks/pre_init.js on the app
      this.emit('pre_init', this);
  
      // Run initialization code
      this.initialize();
  
    }
  
  }