Update indexedDB.js

some bug fixes
and trying to implement object/model way to initialize indexedDB