Major refactor. Introduction of Logs, and persisted sync events. Transactions applied more carefully. Some failures persist in the test collection, which will be corrected ASAP