The molecular origin of high performance in ternary organic photovoltaics identified using a combination of in situ structural probes