Allow using encoded images in Datum, LevelDB, LMDB

This PR allows to store the image files directly into the DB, which saves a lot of space and sacrifices only a little bit of speed (not noticeable since it is done during the prefetching).
- To convert a set of images and leave them encoded (just copy the copy image file) do:
./build/tools/conver_imageset -encoded=true 
- Added a TIMING flag to Makefile to see if prefetch is fast enough compared to the forward/backward pass.
  - To use add TIMING := 1 to your Makefile.config
  - This would display the time used in prefetch (reading images + transforming images)
  - The time used in the forward pass 
  - The time used in the backward pass
- Speeded up and update the code in WindowDatalayer:
  - Now it read and transform faster the window images into blobs.
  - It has an option to cache_images into memory in case of slow HDD. It caches the encoded images to save memory.
  - Now it also accepts mean_values instead of mean_file.
- This PR also speed up the transformation applied to cv::Mat, this should allow to add easily new transformation done directly with cv::Mat using OpenCV
I'm pretty sure this Timer implementation isn't thread safe when Caffe::mode() == Caffe::GPU.  It frequently causes a segfault in the cuda driver on my system.

It's implemented using the ```cudaEvent*``` API which records events with respect to the active cuda stream.
http://developer.download.nvidia.com/compute/cuda/4_1/rel/toolkit/docs/online/group__CUDART__EVENT_ga324d5ce3fbf46899b15e5e42ff9cfa5.html
"Records an event. If stream is non-zero, the event is recorded after all preceding operations in stream have been completed; otherwise, it is recorded after all preceding operations in the CUDA context have been completed."

src/caffe/util/benchmark.cpp
```
void Timer::Start() {
  if (!running()) {
    if (Caffe::mode() == Caffe::GPU) {
#ifndef CPU_ONLY
      CUDA_CHECK(cudaEventRecord(start_gpu_, 0));
#else
      NO_GPU;
#endif
    } else {
      start_cpu_ = boost::posix_time::microsec_clock::local_time();
    }   
    running_ = true;
    has_run_at_least_once_ = true;
  }
}
```

In any case, I'm pretty sure you don't want your prefetch timer to be synchronized with what's happening on the GPU.