Quickly pack a nested 2D array into a typed array – useful for flattening point data into a WebGL-friendly format