Add support for python 2.6.

pypy and Python 3.x will be difficult due to differences in the codec library.