Got automatic DOM rearrangement working, sort of.