allow matching on presence of a key when value is a dict

Not sure this is the best way to do this, but as far as I can tell, there is not currently a way to match on the presence of a key where the value is a dictionary. If this is accepted, it might need to also be applied in the case of grains.