More work on unit tests and documentation