Convert ext/ctype to HNI

Part of #1480.