Fixes to JSDoc.
Added serialization to string.
Added JSDoc.
Improved output of the example scripts.