Introduce a backup storage API and improve testability.