U.S. electric carmaker Tesla broke ground on a gigafactory in Shanghai, its first outside the United States.