Add documentation, clean up.