Redid some of the code to make it easier to add more rule types.
Added a timerange for the rules when they are active, defaults to always on.
Added custom error messages.