saveSettingsToJson function

Save a settings object as JSON file