Correctly include header files in the main CMake so the source are available for sub-projects. Refactore Rule namespace.