Photoelectrochemical methods for semiconductor device processing