Refactor helpers and pull out tests
Only process style sheets that match the given pseudo-class