Revert "Do not use List::AllUtils->pairs"

This reverts commit 5e80a53fae1ad469478ea2afc84f96d68a156525.
Don't use "pairs" from List::AllUtils

Don't use "pairs" from List::AllUtils because it requires a newer
version of the module.

This is the same as commit 5e80a53fae1ad469478ea2afc84f96d68a156525,
but does not use nested lists where any elements of the inner lists
except for the first two would be ignored, creating a pitfall for
future maintainers.
Merge remote-tracking branch 'chirlu/no-pairs' into beta

* chirlu/no-pairs:
  Don't use "pairs" from List::AllUtils
  Revert "Do not use List::AllUtils->pairs"