Heavily cleaned up the structure of the code, added a setup.py file which uses distutils (even though setuptools is recommended, this is a fairly simple build, so didn't see the need to use it) to package the code. This can now be installed on a system and imported like any other python package. I'm sure there's still lots of ways to improve all this, but for now, this is a lot cleaner to work with. Next commit will add config files and logging