Fix sqlformat script to be Python 3 compatible

This is enough to make it run here (tested on Python 3.3)

The branch adds a minimal sanity check to `tox.ini`, but a better test for the script would probably be a good idea.