CLEANING: move JS to footer and code formating

This is a significant change to help streamline JS and prevent blocking
JS on page loads. I moved all the JS into a content block
footer_content, in the process I streamlined a few files and improved
code formating.