Excited state torsions and electron transfer in dye-sensitizers for light harvesting and photodynamic therapy