Refactoring Drupal batch API callbacks to increase testability