First-principles studies of K 1 − x M x MgH 3 (M = Li, Na, Rb, or Cs) perovskite hydrides for hydrogen storage