Update to sync keys prior to syncing the collection.
WIP
Formatting consistency, better handling of table name change
Significant simplification, including removal of the separate sid field