Remove JavaScript variables from global namespace

As these variables were being assigned without being explicitly
declared, they were implicitly added to the global namespace.
    
This commit removes 41 variables from the global namespace.

Additional cleanup:
- Remove superfluous whitespace/newlines
- Remove commented window.alerts
- Remove commented code
- Remove obvious comments, obviously
- Remove commented hacks
- Avoid use of Array/Object constructors

Note: This file contains a mix of hard and soft tabs. All additions use the standard 4-space soft tab, per the style guide.
This line actually _does_ fix indentation. If you peek into this file
locally, it's a terrible mix of whitespace. Some lines use tabs, some
use spaces, and most even use both!

The visual disparity is due to Git and/or GitHub display displaying
hard-tabs as 8 spaces.

Every line I've added in this PR consistently uses 4-space soft-tabs,
per the edx style guide.