private function registerDirectory($basePath, $prefix = '') {
		$basePath = str_replace('\\', '/', $basePath);
		$basePath = rtrim($basePath, '/') . '/';
		$prefix = ($prefix ? $prefix . '_' : '' );
		$files = scandir($basePath);
		foreach ($files as $file) {
			if ($file[0] == '.') {
				continue;
			}
			$path = $basePath . $file;
			if (is_dir($path)) {
				$this->registerDirectory($path, $prefix . pathinfo($path, PATHINFO_FILENAME));
			} elseif (strtolower(pathinfo($path, PATHINFO_EXTENSION)) == 'php') {
				$name = $prefix . pathinfo($path, PATHINFO_FILENAME);
				$this->classMap[$name] = $path;
				$name = str_replace('_', '\\', $name); // register again in case it was namespaced
				$this->classMap[$name] = $path;
			}
		}
	}