Mathematical Models of Locomotion: Legged Crawling, Snake-like Motility, and Flagellar Swimming