Add TOC

Plus set heading levels and
Fix a typo
Fix JS example code to be the same as in its description.
Merge pull request #2 from thamas/master

Add TOC by @thamas