Implement support for cache validation

Adds a Last-Modified header to each response, and returns a 304
"Not modified" response when the request contains an If-Modified-Since
condition that evaluates to false.

Also adds support for HEAD requests because some caches will try the
HEAD method first to verify that the server sends a proper 304 response
on unmodified files.

Also adds the Content-Type header to 404 responses, as required by the
PSGI spec.

For the package index files a "Cache-Control: no-cache" header is added.
This doesn't mean that a downstream cache can't cache the content;
it just has to always treat the data as stale and revalidate for each
request if it has changed upstream.