Improved documentation.
Added more functional tests.