Japanese tech giant Panasonic is planning to pare troubled business lines and its work force by thousands as it aims.