Initialize cached filenames lazily

Working on caching patches. I want to be able to manually set the basename of the cached file after initializing the download strategy. This patch does not enable that, but makes it possible to enable it later.

As a bonus, it gives a modest speedup when running commands that load all formulae, because the filenames are only computed when needed.