Moving main.js to a separate file. JSHint + Refactoring