Documentation and code refinements
Docs update and fixing up the library code.