String equations in Whitham hierarchies: τ-functions and Virasoro constraints