Updated Readme. Started refactoring and cleaning up code. Fixed a couple of bugs.