unify imports extraction with related

unify implementation for identifying imports by comparing diff from
invoking related() after identifying added/removed stylesheets.