(#3285) - refactor idb changes

Also fix a small thing I noticed with blob support:
if the DB is cached, then we should use the `api._blobSupport`
from the cached DB. Looks like before, we would just assume
no blob support the second time you opened the database.

Also used `utils.Map()` instead of `{}` where
appropriate.