lib: added jsdoc comments, updated README.md.