RFC109: Refactor Application of Runtime Substitutions (#4877)

- Rewrite substitution loops to first check for available VALIDATION
  patterns before looping through KVP pairs. This is possible because
  VALIDATIONs are mandatory, and speeds things up substantially in the
  general case when there are few/no substitutions to apply

- Allow runtime substitutions to apply to map->metadata,
  layer->metadata, and all outputformat->formatoptions