Add partition, partitionAll, and partitionBy

partition produces an array of arrays, each containing n elements, each offset by step (optional).
It also allows an optional padding array which will attempt to fill the last partition to n elements if short.

partitionAll allows the last partition to be less than n elements long without using padding elements.

partitionBy applies a condition to each element in array, splitting it each time the condition returns a new value.