Factor out logic for getting importPath and rev.
Add hacky support for golang.org/x/... packages.

This will have to do until this problem is solved in a more general way.