First-Principles Study Of Ion Ordering And Diffusion In Layered Oxides For Na- And K-Ion Batteries