New option -p, --database-dir

This option accompanies the -d option, which is renamed from --database
to --database-name to remove ambiguity with new option. The new option
overrides the call to chdir_to_db with a plain call to chdir. With these two
options combined one can now fully specify the absolute database to use,
on the command line.
Bugfix: comparisons to ERROR and SUCCESS