Refactor setting save/load. Misc JS cleanup.
Merge pull request #14 from Chaser324/pref-saveload-cleanup

Refactor setting save/load. Misc JS cleanup.