DSG: continue refactor of sync message code. Does not compile yet.