Changed so that handler mappings are stored in a ConditionalWeakTable to avoid possible memory leaks.