Add flatten method to NSArray.

This adds a flatten method that will return a 1D array of items from a multidimensional array of arbitrary tree length. It flattens iteratively for up to 2 dimensions and then uses recursion for all odd dimensions greater than 2. Figured an efficient solution for 2 dimensions is all that will be necessary in the most common use case.