Refactor bash scripts used in rendering and command-line tests
The purpose of this MR is to reduce code duplication between the fuzzy comparison functionality present in the CLI tests and an analogous worflow newly added in rendering tests (see !5015 (merged)).