Segment in courier

This moves the segmented fetch logic out of discover and into the courier. Tests are incomming.

Required by #2196