WARRANT AND PREFERRED STOCK PURCHASE AGREEMENT