Added Query streams wherever possible to ease server load.

Had to put this ugly construction everywhere too much data might have been fetched at once using a query stream and some counters to keep track of when it's finished. It works.