added minimal REPL for query, stats, etc