compatibility with python 3.2

Changes necessary to make purl compatible with python 3.2 and 2.7. The test suite passes (at least) on these two platforms.