Fix Batches class to run on 3.1

The method signature for task_message_handler changed in version 3.1 and the Batches class needs to have that method signature updated in order to work.