Fixed JSHint issues with code.

Maintained functionality of the code while correcting issues pointed out by jsHint.

People that run code validation through jsHint will no longer need need to stare at warnings generated from this file.