Switch to json for prefs