RefineX: Learning to Refine Pre-training Data at Scale from Expert-Guided Programs