Clean up jsdoc comments

Add class properties, expose some methods that should have been documented, etc.

This pull request contains changes from #636 rebased on top of the current master. I have also fixed few minor details like too long lines or markdown formatting.

/cc @crandmck