Replace the legacy backups implementation with a new one.

The new implementation is refactored to fit to the new backups approach of storing the backups in env storage (along with metadata in mongo). This is the final large patch in the backup series (the remaining ones are much smaller).