Complete rewrite to support iBus 1.5.0 and above