Python 2.6+ and Python 3.1+ support changes.

CLA signed.

Much of this is based on the work done by dude-x.

I recommend considering Python 3 support to be experimental.  My expectation is that Python 2 should work as it did before, as long as Python 2.6 or above is being used.  This was deemed an acceptable support limit as Python 2.5 was last updated May 2011.