Improved replica sync. Refactored backup tests.