split reference update logic in ModuleImporter into ImportUpdater so that it can be reused
support nested require for unused imports