Replace global Hash usage with TS::Cache

This adds `thread_safe` gem dependency, do you want me to regenerate `Gemfile` and `arel.gemspec`?
Visitor instances aren't shared among threads, so I don't think we don't need these. (Side note: I'm not sure that those caches are useful anyway)