Implement database model upgrades, catversion, and a new model, fixes #5.

That new model allows fixing #5 by storing the database connection URI
given by the user at register time exactly as is, rather than trying to
play smart with its parsing.