Predicting the Structure Stability of Layered Heteroanionic Materials Exhibiting Anion Order.