(#1921) - WIP - implement returnDocs for websql/idb

This may be way harder than I thought, but it's going to be ace for improving performance in mapreduce, since mapreduce doesn't need all the changes to be stored in memory at once.