Court agreement reached to replace thousands of water lines in Flint, MI