First full implementation of the sync process.
Tested in the SyncTest class (basic test).