Moved the thread storage to a per instance level, vs global

Closes-bug: 1348318
Change-Id: Iad912f7dfabfe323fa647d94b38fdc79ec8a6d16
Merge "Moved the thread storage to a per instance level, vs global"