Support for Python3 and Django1.5+, added tests

I know this goes a bit against the contributing guidelines but it wasn't easy to split the work into smaller, independent PRs. I tried to keep the changes to the original codebase as small as possible and I'm open to other compatibility strategies if you don't like mine.