A bit of cleanup / infrastructure 2

As discussed in https://github.com/lpaioro/astropy/pull/1
let's run `autopep8` later to keep the diff readable.