protected function initializeModule($path, $activateDependencies = false)
    {
        $moduleNamespace = $this->getNamespaceFromModuleJson($path);
        $module = $this->getModule($moduleNamespace);
        
        // If the module is already initialized, return it
        if ($module instanceof ModuleAbstract) {
            return $module;
        }
        
        // Try to find and load the module
        if (!file_exists($path . '/Module.php')) {
            throw new Exception('The module "' . $path . '" is not valid!');
        }

        // Look for dependencies and warn the user or activate the dependencies
        $this->handleModuleDependencies($moduleNamespace, $path, $activateDependencies);
        
        // Load the module
        require_once($path . '/Module.php');
        $moduleClassName = Framework::prepareClassName($moduleNamespace . 'Module');
        
        // Initialize the module
        $module = new $moduleClassName($this->framework, $moduleNamespace, $path);
        $this->modules[$moduleNamespace] = $module;
        
        $module->initialize();
        
        return $module;
    }