Changed to javascript strict mode.

Also fixed errors with undefined variables deprecated use of octal
numbers.