Add documentation to index.js

I didn't change any code functionality, but I was going through your index.js, and I noticed there wasn't much documentation.  I added a few comments to clarify what was going on.

Great project.  I'm looking forward to using it!