Make retrieval work with client's new Ingester interface.

This is only a refactor, no new functionality.