Decode url paths more thoroughly before passing them into contents api functions.
Fixes #9895
There still is some work to do here to make it very clear where we are dealing with urls (which may have query parameters, protocol, etc.), where we are dealing with url paths (i.e., a url component, just the path portion of the url), and where we are dealing with just plain posix-style paths. For example, resolver.isLocal seems to conflate all three concepts.