Added tests.
Added documentation.