Add support for Python 3

This adds compatibility with Python 3.

Note that it includes Tox and Travis stuff from #1 and #2, because this was useful for testing my work. If those PRs are accepted, then I can rebase my branch and those changes will disappear from this PR.