Added the flattenMany function: flatten a potentially unlimited number of lists into one, with a given maximum depth