NOTE AND WARRANT PURCHASE AGREEMENT