The money-losing network had struggled with he hefty cost of buying American programs. CBS plans to use it as a testing ground for streaming.