Tidied up the main code, splitting it into modules. Added some tests and packagified everything
Modified setup.py to include new version number