BP will put a down payment on a cleaner future by buying a company that produces natural gas from the decomposition of organic waste.