Add documentation and tests.