Properly iterate through head elements
Skip print stylesheets
Move replaceRule to its own class function