Text this: Electronic Structure and Magnetic Coupling of Pure and Mg-Doped KCuF3