JModelAdmin: Batch optimizations

This PR optimizes the batch process and removes a lot of duplicate code. It adds 2 new variables that let you define the tasks to do and a copymove task before those additional tasks. That copymove task might modify the IDs of the items to treat and thus needs to be handled differently.

This modification is backwards compatible. To test, please simply check that all batch processes in all combinations still work.

It would be preferable if #5317 would be merged first. This PR is based on those changes and will automatically adapt if #5317 is merged.