Behavioral Dynamics and Neural Computation for Sensory Navigation in C. elegans