Rework rule construction mechanism
This pull request, when merged, changes the following:
- Allow for service injection in Rule classes;
- Move the validation of rule parameters from Rule classes to a separate class;
- No longer use the static 'new' function to construct Rule classes;
- (bug fix) Use effective groups instead of normal groups for "inanygroup" and "inallgroups" rules.