Modularized JavaScript in the index.html file

Took the script embedded directly in the index.html file and placed it in
its own 'script.js' file in the source directory.