Add more tests and documentation.