Improved documentation and basic unit tests