cartesian product on  arrays (tests won't pass...). issue #444.

Don't merge, because for some reason the tests do not pass (although I can't tell why, the code is pretty simple and works on small examples). If someone could take a look...