Improve and extend tidy.py, and run it on Travis.