allow custom resolve function

Allow a custom function to resolve require calls.
This functionality was present until version 4. It
is still present in module-deps.