Code cleanup and documentation for initial release.