Structural and electronic properties of ion-exchangeable layered perovskites