Improve README.md
Add JSDoc documentation.

Add JSDoc documentation and fix code so that jsdoc 2.4 tools can parse it.

Documentation is written for JSDoc 3.x, but works also with 2.4 except that
2.4 does not have ways to document modules and does not play nicely with
namepaths used in the documentation.
Add "use strict"