added a readme and split up the code a little more into sensible modules