Materials and devices for solar generation of electricity and fuels