Add Python 3 Support

This patch adds support for Python 3.

I've tried to make the minimum changes necessary to the code; a few unicode casts here and there, a minor rework of a sorting function and some changes to the expected results of the middleware tests when running under Py3.

Setup now runs 2to3 before installing / testing and that takes care of the rest of issues.

All 195 tests pass successfully under:
* Python 2.6
* Python 2.7
* Python 3.2
* Python 3.3