ArrayToList function

Split an array into list by a given array dimension