Heterogeneous electrochemical systems for solar energy conversion