improvements to argument parsing

When running the default output format (database), an output directory needs to be specified. I added logic to provide an appropriate error if the output directory is missing. I also fixed the extant_file() function so it passes the error it throws properly. Finally, we can use also extant_file() to check if the output directory exists, so I applied that function to the directory argument's type.