JS Linting with JShint

Used JSHint to go through and find all variable used without declerations
and all variables declared multiple times including many 'i' variables
that were being declared in for loops.

For the undelcrared variables a var statement was placed at the top of the
functions they were in.
Update version in readme