Make config.py a proper Python source

This was just a huge pain to deal with in the autootls boilerplate when
building or installing, and it's becoming impossible with unit tests.

The scripts are already generated (mainly because the path to Python in
the shebang is computed at configure time), so let's move all the
configure/build time generation there.