KSync code reorg - phase 1