Remove unnecessary code, add docstrings.

See #75.