Adding (temporary) debug logging for IDB.

Fixing bugs in empty where we wipe out the root directory.

Wrapping all user-supplied callbacks for read-write transactions in setTimeout to commit transactions before returning to user code.