Refactor Mango warning generation

Refactor the code generating Mango warnings to (hopefully!)
improve readability.

This also moves the metric counter for unindexed queries such that it
gets incremented only when no index is used. Previously, it would
increment if *any* warning was generated (e.g. when Mango warned that
the user-specified index was not found/valid but fell back to a
different index).

The warning string returned now also contains all warnings generated
for the query, delimited via newlines - not just the first one.
3 files changed