CMake build system - cleaned 

CMake build system from #442. Added LMDB support as in #571 (#kloudkl I hope you won't hold it against me)