Fixes for batch move, some refactoring

Had to do some minor adjustments for batch moves.

I learned that tableview does not like section additions/deletions and moves in the same batch update. There is literally no way to get it to work reliably.