CBLT-82:  import from voltron/sync_gateway

Change-Id: I699a31cf54148270fcb247799f55301bfa4edf56