General Motors has been upgraded by Moody's Investors Service to an investment grade rating, from Ba1 to Baa3, with a stable outlook.