add JSDoc3 documentation, improve README.md