[bindings] Extract import resolution logic into a separate struct