PEP 8 compliance

I was really terrible at writing compliant Python back in the day.
This commit is an attempt at fixing that by making the script fully
PEP 8 compliant. This includes W(arning)191 (using tabs instead of spaces),
so most of the changes are mangling tabs to spaces.