A simple, low-memory footprint function to generate all combinations from a multi-dimensionnal array.