It was only a matter of time for Tesla to come to this conclusion. Buying batteries from a foreign supplier left them vulnerable in the long term to single-source risk: suppose Panasonic had a fire, or raised its prices exorbitently? Not to mention that Tesla has no real control over the timing of manufacture or the design of the batteries themselves. It's too much of a risk for the major essential component of their product.
Tesla Motors may make its own batteries