Structure and stability of the clathrates Ba8Ga16Ge30, Sr8Ga16Ge30, Ba8Ga16Si30, and Ba8In16Sn30