Use localStorage to handle preferences in javascript

I have changed how the preferences are handled, along the ideas you mentioned. Now both the watch app and the javascript part store their own copy of the preferences. 
It is a very simple and robust solution, seems to work very well and will solve the problem with the app reverting back to defaults.