Flatten an arbitrary length array of nested arrays into one array.