Move CSV handling to QueryContext

We want to consolidate access to the outside world
behind this facade. That makes it possible to handle
freeing of resources in QueryContext's, instead of
having multiple places remember to clean up state
after a query is finished.
Merge pull request #2019 from davidegrohmann/2.0-load-csv-query-context-refactor

Move CSV handling to QueryContext