log/output cleanup; tests/query_parse rewrite for new support