Updated dependencies

Restored explicit dependency on ref gem
Updated thread_safe gem, removed monkey patch