Fix some jshint warnings

I ignored the warnings about __proto__ because it has been revived in ES6; the "already defined" and "out of scope" errors deal with earlier definitions in alternative cases in a switch statement, or inside a try block.

12 warnings
27	The '__proto__' property is deprecated.
43	The '__proto__' property is deprecated.
165	Missing semicolon.
219	Use '!==' to compare with 'null'.
296	The body of a for in should be wrapped in an if statement to filter unwanted properties from the prototype.
358	'value' used out of scope.
360	'obj' is already defined.
361	'value' is already defined.
390	'result' used out of scope.
392	'obj' is already defined.
402	The '__proto__' property is deprecated.
403	The '__proto__' property is deprecated.