Corrected rule activation error

- huge refactoring in VariableMask and all files that used it
- semplified a lot all the handling of variable masks
- variable counting done with a simple vector