Incremental changes toward encrypting sync traffic. The changes are incomplete,
but all legacy functionality appears to still works.