Channel softmax

In this pull request, the behavior of SoftmaxLayer is changed from softmax over `channels*height*width` elements (all elements within a num) to softmax over `channels` elements (all elements at a spatial position within a num). This is for the purpose of running fully-connected layers as convolutions (see Net Surgery: http://nbviewer.ipython.org/github/BVLC/caffe/blob/master/examples/net_surgery.ipynb). It won't damage existing caffe examples, since fully-connected layer top blob has `width==1` and `height==1`.

The CPU version was implemented by @longjon, and I implemented the GPU version, including GPU backward.
Yeah, good catch. I did this to avoid an extra loop, but I've added it back now to allow in-place computation. There should be no performance regression in the 1x1 case, and probably not a noticeable one in the general case, and anyway the GPU implementation is available.

In order to do this, I had to add functions to `math_functions` for strided dot products (which of course cblas already supports, but we didn't previously have an interface for.)