Preliminary implementation of cartesianProduct.

For the case of two infinite ranges, use Andrei's schedule of traversing
right and bottom edges of an increasing square area over the infinite
table of combinations. This allows us to only need to traverse each
range in one direction, so only forward ranges are needed.
Add cartesianProduct to cheatsheet.
Replace unittests to avoid issue 8542.
Improve unittests.

Make unittests independent of exact order of pairs produced by
cartesianProduct.

Add unittest for cartesian product of two finite ranges.