Clean up JavaScript files

Very minor JavaScript fixes across-the-board. Determining a common indentation style (whether that be tabs or spaces) would help with readability.