Modified the rules according to new interface

Now a rule only has an apply function