Also update the code somewhat following the changes in the Cabal API for path templates and substitutions.