Move pathMap to separate file and add test.
Created by: varungandhi-src
Follow up to https://github.com/sourcegraph/sourcegraph/pull/29978#discussion_r788846298
Created by: varungandhi-src
Follow up to https://github.com/sourcegraph/sourcegraph/pull/29978#discussion_r788846298