resolve

Implements the node require.resolve()
algorithm
except you can pass in the file to compute paths relatively to along with your
own require.paths without updating the global copy (which doesn't even work in
node >=0.5).