Updated main.js after running through jsbeautifier.org to standardise indentation, etc.