Tesla's longtime battery technology director leaves company