Photoelectrochemical and photocatalytic production of solar fuels