General cleanup and documentation.