Tesla reached a preliminary agreement with the Shanghai government to build a factory that’ll rival production from its lone U.S. assembly plant, as Elon Musk takes his biggest step yet to expand overseas. Planned capacity is 500,000 vehicles a year.