A spectroscopic study of charge separation in photocatalytic and photoelectrochemical water splitting devices