Improved and expanded CDS test utils; updated CDS tests to use new utils. Reviewed-by: jiangli, ccheung