Tuning the electronic and optical properties of molybdenite (MoS2) by adsorption of alkali metals and halogens