Fix formatting.
Try to obey google style guide.
Replace all `caffe_*()` cpu functions with `CPUDevice` functions.