As much as 40 percent of the country’s food supply gets thrown out. In Massachusetts, Vanguard Renewables, its farm partners, and companies including Whole Foods are combining that food waste with manure to produce renewable energy.