If database-root is given, the database dir is computed by
appending the base dir to it. Obviously this works only if
base dir is given, even for select mode.
The needed directory structure is created below database-root
by the new function mkpath(), which recursively creates any
directory needed to copy the structure of base dir. This
has the side-effect that the database dir is always created
for the user (if permissions allow) which wasn't the case
before.
database_dir is now a global variable just like conf and should
be used whenever conf.database_dir_arg was used before.