Seol mar théacs é seo: Counting points on curves over families in polynomial time