Create cache directory

This pull request adds the creation of cache directory.
both of those should be unnecessary, just leave it at is_hash()