Updated README. Added unit tests. Other small changes to code comments etc.