Mostly minor documentation and sample code fixes

These three commits contain several grammar and typo corrections in the website and JS documentation plus some syntax error fixes to the website sample code. Let me know if you want me to squash them into a single commit in a new branch.

Also, I had my IDE set to remove trailing whitespace when I made these changes which created a few non-interesting changed lines. :(