Added unit tests and documentation for tests.