New thread-local API

- `SafeGlobal` gone in favor of `SwappableDict` and `ThreadLocalDict`
- Swapping API instead of stack API
- `thread_local` context manager takes care of cleaning up (fixes #26)