Generation and modulation of chemosensory behaviors in C. elegans