Home-Grown Software Gives Tesla, Facebook a Competitive Edge