I learned about simple-prefs recently, from reading micropilot code (micropilotlog) that might be useful here