Tesla will spend more to increase production at two new factories.