Recursively flatten an array or arrays.