Re #7494. Improve handling of error conditions.
Re #7494. Add tests that don't load data files.
Re #7494. Small tidy-ups in the algorithm.

Mostly the addition of const in several places.
Re #7494. Remove tests that load data files.

The new non-loading tests should be sufficient.
Merge remote-tracking branch 'origin/feature/7494_moderatorTZeroLinear_tidyups'