loader: extract the resolution and the loading of module in `import` clauses