A GM car that "drives itself" will be on sale by the end of the decade, according to General Motors.