Enhanced the batch handler to output error messages; added more tests and new provider that dumps docs selected by a query