Introduced SmartDownloadMiddleware

Makes it possible to setup several rules given a single optimization backend.
Refs #25