Added CMakeLists.txt and modularised libraries