Made the directory check code more efficient
Fixed docblock
Merge pull request #199 from tedious/filesystem_optimizations

Made the directory check code more efficient