Mid-segment switch using tagbuffers

Instead of #164 and #168.