I think it would be cleaner if you handle the case where this is a new database (i.e. where there are no existing object stores) here and only call handleUpgrade() when you are actually upgrading an existing database.  If you just test for it once here, then you don't need to test for it in the upgrade logic. below.

Creating a new database is fast and I don't think we need to trigger the upgradestart and upgradeend events for that case.