Code refactoring

Hi !

I just found your project on reddit and thought about sending you some feedback. 

Basically:

- I replaced double quotes with single quotes
- Added missing radix parameter to all the parseInt calls
- Added missing semicolons and removed unnecessary semicolons
- Caching lengths in for loops
- Adding missing brackets in if's
- Using strict equals in if's

Cheers.