Add documentation, cleanup.