Merge pull request #3387 from kgaillot/best-practices
Move some rule support functions to libcrmcommon