Luminescence and photoelectrochemistry of CdS thin film electrodes