Fix JSHint complaints

This should appease the JS syntax gods by fixing most of the JSHint complaints we get with our current config.