Refactored the settings (config) system as per issue #2216