Support more advanced proxy caching

Added a download cache to the proxy server, which defaults to a noop
implementation. A disk cache can now be added to support better proxy
caching.