Moving code to a real plugin
Adding patch for the main CMakeLists.txt