Refactored tests.
Validation added when editing rules. 2 rules with the same rule type and target folder can  no longer be saved. A message also informs the user of this.