Reformatted code and most comments and repackaged classes.