Improve DRY of _main
Adapt doctests to new option `Pdb_on_Exception`