add basic REPL support
Don't exit the program after a query, and code-formatting tweaks.