Added padding support to arraysplit

Our implementation of `arraysplit` was always dropping the final elements in the input array. I added an optional argument `pad` that, if set to `true`, will pad the array with zeros before splitting (so the extra elements are taken into account as well).