Fix tests to pass on Python 3
Drop Python 2.6