Restructured db

Also one thing to look out for is that indexeddb has compound index.