created a helper function for initializing a 'db' instance.

added another argument to the constructor that is a callback for when the indexDB onStoreReady state/function is called.

also made the constructor work if there are only 2 arguments and one of them is supposed to be the 3rd argument callback function.