setup.py, robustness, user-friendliness

Hi,

I just stumbled upon this project today because I needed something similar for our application. Thanks for putting this together!

I made some changes which I think makes the code more robust and correct, and also makes it easier to install by adding a setup.py (you may want to add additional fields to the setup.py that I didn't fill in). Please take a look at these changes and let me know what you think.

Would love to see this end up on PyPI!

Thanks,

Jonathan Kamens