im2col: implement N dimensional sliding, and fix sampling order for distinct.
* im2col.m: one more complete rewrite of this function for performance,
implementation of N-dimensional sliding blocks, and maximize shared code
between the two block types. For distinct block, this also fixes the Matlab
compatibility where sampling was done the wrong direction (now it samples
first down and then left) and change the tests accordingly. Implement distinct
blocks with more dimensions than the input matrix. Pad indexed images
correctly (padvalue of 0 only for uint8 and uint16). Rewrite documentation
for all the changes. Add more tests.