Change so that the Match group ID is created at the start.

Instead of at the end of the match group. Now it is based on the data in the obstruct image instead...

This is so that we can have output_paths that are generated based on output variables, for instance creating a directory for each match_group_id and saving all the related images in there. This would not be possible if the match group id was generated after we generate the path.
Enable using template output variables in the output path.

This enables grouping of output into directories and such by match group for instance.