Merge master into sync_gateway

Merge to make cbdatasource code available to sync gateway.