Move all imports into their dependencies.