Completely rework import resolution.