Merge pull request #5 from joseeight/tests

Ensure IndexedDb is closed and more tests