Documentation and refactoring (triggered by finding silly things to document).