convertSettingsToJson function

Convert a settings object to a JSON string