Tesla has signed a preliminary agreement with China's Tianjin Lishen to cut its reliance on Panasonic.