Merged commits from @drewmccormack into iCloudBasedSync

Manually merged a selection of the latest commits from @drewmccormack into feature/iCloudBasedSync. I filtered out some commits that don't apply and some that made problems and were removed by Drew a commit later.

You find the reference in the commit messages, as I copied the commit messages Drew wrote.

Those seem to improve the performance a bit.

Best regards,
Christian