Issue #45 ContextManager not being thread-safe
Removed some dead code