I think we should make the initialization of IndexedDbCache asynchronous. Then we wouldn't need _database wrapped in a Future, and a lot of code below would be simpler and more efficient.