Make derivatives test more general
Description
Remove access to internal memory of batches and use batch_set_state and batch_get_state function. This makes the test independent of the representation and logics of the batch.
Checklist
-
I have checked that my code follows the Octopus coding standards -
I have added tests for all the new features added in this request.