Generic permutator written in Rust that permutates both lists of lists and singular lists using references.