Analysis of MHD stability and active mode control on KSTAR for high confinement, disruption-free plasma