`all_equal` should determine whether all elements of the array are the same. `flatten`, if given an array, should flatten the top axis.