Greatly improved the layout of the javascript file, and I cleaned up the code, as well.