Implement variadic cartesianProduct

This pull request extends cartesianProduct to 3 or more arguments.

I'm running into a bit of a snag with the unittests, though. Currently I've commented out the last unittest because it runs out of memory on my machine. Can somebody help me find out what's eating up so much memory? Does the cartesianProduct implementation need some tweaking to reduce its memory footprint?