Memory persistence backend improvements

* got rid of globals -- all data now belongs to backend instance;
* be more accurate and consistent with copying saved data.

Change-Id: I3e54415e23b7df03e48de3d6c0800f0149051560
Merge "Memory persistence backend improvements"