unify imports extraction with related

unify implementation for extracting imports by comparing diff from
invoking related() after identifying a stylesheet was added/removed.