Isolated the module dealing with c++ rules (to avoid global variable)
Renaming add-rule to add-rule!
Moved things to the isolated module