more efficient reordering

fixes Matt-Esch/virtual-dom#90