Use context managers properly.
Groom imports.
Properly process sys.argv. Fix #956.
Install a main function.
Use argparse to parse the arguments.
Activate coverage testing of db package.
Factor and test argument parser for migration scripts.

* Fix `path` argument.
DRY argument parsing in migration scripts.
Fix update_db shell script.

* The shell script should be replaced by an all-python script.
Merge pull request #962 from Renelvon/sane_migrations

Groom migration scripts.