Added database upgrade script

The upgrade-database.py script checks for database changes, and upgrades the database if necessary.

I don't know how many people would use this, but if you think it is helpful, I can write new version definitions and upgrade scripts whenever the database changes.

I am also able to help with new features if you want help.