Added more tests and documentation.