OpenCV 3 build update and other minor fixes

Changes are pretty similar to #1247 except I just omit the OpenCV module names from the CMakeLists.txt so that it selects all of them and I also use the opencv2/opencv.hpp header rather than each individual module header so that I don't have to test whether or not to include the imgcodecs.hpp header.

This change also adds a test in the softmax loss layer to check for a dimensionality mismatch and includes a header in cudnn.hpp to make sure glog is available.
Done.
https://github.com/kmatzen/caffe/commit/52630a616ce43a581306bdd7a56135275f75c9c2