Tidy up index creation and cleanup in tests

Use create_test_indexes and clean_test_indexes instead of a variety of
calls to create or delete individual indexes.

This fixes some occasional fails; some tests were only passing if other
tests ran first and left "metasearch-test" indexes around.  After this
commit, the tests should all create the indexes they need, and clean up
properly after themselves, so failures should be more deterministic.
WIP Tests for deleting documents by `_id` and `type`.