Fixing leading and trailing whitespace issues per PEP8

Roughly the equivalent of the following in vim:
```vim
:set tabstop=4 shiftwidth=4 expandtab
:retab
:%s/\s\+$//
```