Added documentation and tests.