Updated JS Code

Made re-usable variables global.  Added function for reseting list.
Merge branch 'master' into gh-pages