Undulatory locomotion of finite filaments: lessons from Caenorhabditis elegans