Alkaline-earth-metal-doped TiO2 for enhanced photodegradation and H2 evolution: insights into the mechanisms