Make sync more performant

- This commit rewrites the sync algorithm to use the new upload_multi, 
update_multi and delete_multi methods for storages which support them.

- That change doesn't do anything useful for most storages, but
 singlefile-storage benefits tremendously from this.