Maximally informative foraging by Caenorhabditis elegans