Tesla profit, revenue top Wall Street targets but profit margin slips