Add test for applying mappings to documents
Refactor tests to use has_entries

has_entries seemed clearer than multiple has_entry calls.
Refactor send_records_for and add tests

Pull out functions for querying over a date range (query_for_range) and
building a set of documents (build_document_set).