Update documentation, add tests.