Move KE specific stuff into Wazi-generic.