Refactor parts of css.loadAndInlineCSSResourcesForRules()