Rewrite important list reordering code

Avoid reindexing items that haven't changed