Way more changes to the sync code.
Merge branch 'test' into dev