Simplifies access to run Metric Resummarization from /_debug/code.

Improves error handling.
Improves Metric Resummarization's DistinctIdsIterator to avoid
LIMIT/OFFSET which was causing timeouts on large datasets.