Redmine/6553: Fix implicit looping over multiple lists

Pull request for initial review of the changes to the code. Planning to add more test coverage to the acceptance test before merging.
So if I understand correctly, we want to get rid of this too, but we can't because the evaluation logic still depends on it?