Converted library and most apps to CMake structure