Some cleanups.
Some additional API documentation.
More code cleanup