Compress query output
Fixed bug with cached queries and don't load scratch table.

This commit fixes a bug where cached queries that used the shark
server weren't saving the output table in memory.
Added script to run all queries