Split the flush function and associated helpers to a separate file
Remove debug logging no longer needed
Move bench_test to a more appropriately named query_bench_test
Write out intervals in parallel while flushing
Remove some blank lines