Refactored ido extension in mg-ido.el.