Add thread_cached_settings

This pull request allows you to cache settings in thread.
We use it with our rails applications and so far it works great.