(#1649) - fix allDocs() limit=0

Fixes for limit = 0, turns out this was broken in HTTP and websql, also cleaned up IDB a bit.