grids: extracted helper method xyToI
unified kvm, vid, and vt modules.