BZ-1013682 - GRE doesn't recognize formulas, calls on globals, etc. when reopening rule
(cherry picked from commit 18cfa3c0b2982dc6af18e107736ed612f0d04752)
[BZ-1013682] obey rhs statements order when unmarshalling a rule
(cherry picked from commit 1146bafb88fcf2c96bcfeb61f6bbc7caad5d4a08)