Instead of calculating the expected insertion index for a customdata entry being moved, this implementation just records the initial layer indices so that it can compare them with the final indices to determine how the customdata entries need to be re-arranged. Also simplifies the `add_layer` function and adds an implementation that just takes a `name` and adds a new layer with that name to the root group. Pull Request: https://projects.blender.org/blender/blender/pulls/113962