More documentation and cleanup.