Code style fixes.
Removes useless code.
Cleans up main.js.