Code cleanup: moved statement preparation to ::bootstrapDB and db initialisation and upgrading to ::upgradeDB.