Add tox.ini. Fix python 3 support

I thought it might be helpful to have a tox.ini file for testing multiple python versions. I also noticed some various failures for python 2.6 as well as compatibility for python 3. I've included the changes for this as well.