Python2.6 compatibility

I had to index the string format arguments and change one method name to get this working in python 2.6. I haven't tested it in later versions of python; you may need to modify line 227 to ensure forwards-compatibility.