Beginning to move JS to separate file

This will take a bit to figure out. Need to determine what variable
come from where in the app logic.