Elon Musk's automaker Tesla will build a factory in Shanghai for manufacturing the Megapack energy storage product