Refactor data_transform to allow datum, cv:Mat and Blob transformation

Move data_mean into the data_transform class to facilitate data transformation. 
This way Data layers don't need to hold it and pass it all the time. 

...which is why I didn't merge them and made @kloudkl separate the OpenCV changes that @bhack collected. This PR was originally about refactoring the mean, which is what needs merge now, then the other formats were included. While the total transformation refactoring is certainly nice breaking the build is too bad. If you see a a clean way to insulate OS X, like disabling cv::Mat input on that platform, then go for it!