Refactor storage middleware package
Context
The GitLab Container Registry currently supports two storage middleware:
- AWS CloudFront: Inherited from upstream;
- Google Cloud CDN: Implemented in !828 (merged).
Problem
These two middleware components currently share a lot of similar utility methods, mostly for the construction functions and tests.
Solution
Refactor the storage middleware package, extracting common functionality and reusing it across AWS CloudFront and Google Cloud CDN implementations.