Added tests.

Updated documentation.