Battling Resistance to Antibiotics and Pesticides: An Economic Approach