utils.get_directory_name: split into two functions

The utils.get_directory_name function was a generally useful function
but worked specifically on Job instances, preventing it from being
used with other types where it would be useful.

Generalized by making it take a string as the first argument, and
added a second argument to specify a default to return if no name is
found. Also added a get_directory_name_from_job() function which acts
like the old get_directory_name: it takes a single job instance
argument, and passes it along to get_directory_name with a default of
the job UUID.
Transfer backlog: add link to view logs