Fixes #5422: add generic method to check if a directory exists
Merge pull request #104 from ncharles/bug_5422/dev/check_if_directory_exists

Fixes #5422: add generic method to check if a directory exists