Code climate improvements to Spring Insight framework

[#59478422]
Refactor DownloadCache

While refactoring DownloadCache to reduce its complexity, the
following bugs were observed and fixed:

* Bad response codes were ignored [#61019884]

* Download file size was not checked [#61534840]

* Cache reads were serialised [#61212414]

The following helper classes were factored out:

1. FileCache

The file cache handles persistence of data, etag, and last modified
timestamp. It ensures that mutation operations are performed under an
exclusive lock and that read operations are performed under a shared
lock or an exclusive lock.

2. InternetAvailability

This class encapsulates whether or not the internet has been checked
and whether or not it is deemed to be available. Internet availability
may be statically configured in config/cache.yml.

3. BuildpackStash

The buildpack stash is another name for the read-only buildpack cache,
which the class encapsulates.

Acknowledgement

Thanks to Steve Powell for reveiwing the code and identifying some
documentation improvements and the need to check the cache again once
the exclusive lock is obtained (to avoid multiple processes
downloading the same file in short succession).

[#59478422]
Merge 59478422-code-climate to master

[Completes #59478422]