Fix some jshint warnings

I kept the 'with' blocks because they were used rather elegantly, with no chance of confusion or polluting the global namespace; when I fixed "'option' is already defined" I got several "out of scope" errors, and similarly for "'i' is already defined."
I got no errors for fixing "'element' is already defined" but the only other definitions I saw were in other cases in the switch statement; as for __proto__ it's been revived in ES6 so I didn't try to change that.

I similarly ignored the warnings about "Confusing use of !" and "Script URL" because the former is sufficiently idiomatic and the latter cannot be worked around.

15 warnings
20	Don't use 'with'.
25	Don't use 'with'.
96	Unnecessary semicolon.
158	Missing semicolon.
223	'option' is already defined.
239	Use '===' to compare with '0'.
417	'i' is already defined.
424	'element' is already defined.
516	'i' is already defined.
531	'i' is already defined.
556	The '__proto__' property is deprecated.
572	'i' is already defined.
588	'i' is already defined.
625	Confusing use of '!'.
652	Script URL.