Wrap all lines at 120 chars (the standard 80 is just too narrow for
something of this complexity...)
Replace the deprecated '%' string substitution with .format(...)

(after very carefully reviewing the entire commit to ensure
I didn't break anything)
More cleanup...