Add pl_flatten to transform arrays containing other arrays into a flat