Update gen_exp_pattern_classes.py

More tidying up. All the pieces in place to produce useful output.