Bin a 2d array by averaging over non-overlapping blocks.
The 2d array to be binned
The binning factor
The binned array
binArray()