Tesla is firing hundreds of employees even as the company aims to ramp production of its electric vehicles.