Resolve jsHint errors and fix formatting to project standard.

I know I just closed someone else's commit that did pretty much exactly this... but that was before I established the standard JavaScript formatting for the project.