Flattens array of arrays into single array