Allow matching class, name and role in If action
Add window type to If as well

This one required some extra helpers so is separate commit