X Ray Absorption Spectroscopy studies of e-donor and e-acceptor materials for organic-based photovoltaic and photoelectrochemical cells