Fix loading of system config files

Fixed loading of system config files. $mode in the system-wide config now does not load twice. The system-wide default.php config file will always load before $mode config. Added local.php config loading for both system-wide and package-level.