Added tests and improved README.