Add docstrings. Modernize class declarations.