Add ThreadLocal storage class.

This is a simpler wrapper around operating-system TLS primitives. Usage is like:

```
ThreadLocal<Hat *> sWhatever;

...
sWhatever = new Hat();r
```