Electronic, mechanical, thermodynamic and optical properties of CdS under pressure