Processing some queries in batches and new EXPLAIN command

See my comments for #294 and #263