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.
Ah - OK, sounds like there used to be an exported function with this name (as hinted at by the Internal version), it got removed but someone left the declaration.  That would account for the stuff that's confusing me !