Use dictionaries and key/value pruning for #par.final

Now the substitution sets are down to tiny sizes! Still takes
around 2s for the benchmark (which is better than 4 min, but still)