Automated and controlled mechanical stimulation and functional imaging in vivo in C. elegans