rule validation, more work on time restrictions etc.

WIP -- there's still one failing test which needs some time zone
behaviour debugging.