Add lots of comments and fix most jslint errors
Merge pull request #4 from smittal/master

Add lots of comments and fix most jslint errors