moved js link to bottom of body tab in both .html files, with other various optimizations.
Created multiple functions in main.js to save and restore data