Adds get_directory() to test whether the path is a valid directory. If not present create a new directory using path.