Simplified dependency mechanism; added checks; splitted main CMakeLists.txt into modules