Processing some queries in batches and new EXPLAIN command

See my comments for #294 and #263

<!---
@huboard:{"custom_state":"","order":320.0}
-->