More documentation and tests, readme updated