refactor moving, flipping, and updating z-index
Auto update works, but while dragging, it snaps it back
Grouping and flipping with animations with locking to prevent race condition from update loop