Add basic rule validation and the start of tests for rule matching.