Understanding and preventing degradation in organic photovoltaics