Exhibit B AMENDED AND RESTATED STOCK PURCHASE AGREEMENT Dated as of November 27, 2006