Population genetics of anthelmintic resistance in parasitic nematodes