CMake build system - cleaned 

CMake build system from #442. I squashed commits and cleaned the history for easier merging.

I also added LMDB support as in #571 (@kloudkl I hope you won't hold it against me)

Building tips:
```
mkdir build
cd build
CC=gcc-4.6 cmake ..
make
ctest -v
```
(Not sure if `CC=gcc-4.6` is neccesary, but no other version works for me)

Options are specified at cmake invokation with `-D` flag as in `cmake -DBUILD_PYTHON=ON ..`
- `BUILD_PYTHON` [default `OFF`]
- `BUILD_MATLAB` [default `OFF`]
- `BUILD_EXAMPLES` [default `ON`]
- `BLAS` [`atlas, open, mkl`; default `atlas`]
- `BUILD_SHARED_LIBS` [default `OFF`]
- `CUDA_TEST_DEVICE` [default `0`]

Remarks:
- Tested only under Linux Mint 16
No we don't need to do that. It's only an intermediate library that gets compiled into `caffe` target. I would have used an object library, which was introduced in CMake 2.8.8 for exactly this purpouse, if was supported by `cuda_add_library()` command