support python 2.6

This adds support for python 2.6. All tests pass in py26 and py27.