Cleaning up documentation and code file by file.  Progress towards issues #27 and #28.

Added JSDoc style documentation comments.