A device-oriented materials study of CdS and Cu2S films in solar cells