Userprefs save functionality

Added saving of user prefs (alert ranges for gauges for now) to JSON file on disk. File is saved 10 seconds after a gauge is customized. 

Changed most of the code I touched over to PEP 8 guidelines and added a few tests.