Add db version for easier db upgrades

only upgrade db if stored version is less than current version
store current version after db init