Use weak references for listeners, add more documentation