EXHIBIT 10.1 AMENDED AND RESTATED NOTE AND WARRANT PURCHASE AGREEMENT