Cleanup, and began replacing usages of __thread by our templatized TLS implementation.