Use path utilities to rewrite CSS url()s instead of custom algorithm.
Extracts rewriteCSSURLs private function into middleware-ish bits.

Additionally, the middleware is only loaded if a basePath config is provided.
Cache 'good' relativePaths for consumption by later middleware.
Support using cssUrls rewriter as middleware.