Changed cfg to py, removing the "hacky trick"

BTW, the code needs to be tested before all the commented code from the
last commit can be removed and this is merged. :wink: