Updated readme.
Added some functional tests, did some refactoring.