anchor.diff:  
     void _tryResume() {
       if (_onData != null && !_paused) {
  -      if (!_listeners.containsKey(_eventType)) {
  -        _listeners[_eventType] = new List();
  -      }
  -      var event_listeners = _listeners[_eventType];
  -      for (var i = 0; i < event_listeners.length; i++) {
  -        if (event_listeners[i] == null) {
  -          event_listeners[i] = _onData;
  -          return;
  -        }
  -      }
  -      event_listeners.add(_onData);
  +      _target.addListener(_eventType, _onData);
       }
     }
   
     void _unlisten() {
       if (_onData != null) {
  -      if (!_listeners.containsKey(_eventType)) {
  -        var event_listeners = _listeners[_eventType];
  -        for (var i = 0; i < event_listeners.length; i++) {
  -          if (event_listeners[i] == _onData) {
  -            event_listeners[i] = null;
  -            break;
  -          }
  -        }
  -      }
  +      _target.removeListener(_eventType, _onData);
       }
     }
   }
  
positive.code:   }
  }
  
  typedef void EventListener(Event event);
  
  Map<String,List<Function>> _listeners = new Map();
  
  class _EventStreamSubscription<T extends Event> extends StreamSubscription<T> {
    int _pauseCount = 0;
    Object _target;
    final String _eventType;
    var _onData;
  
  
negative.code: // Event handling. This is very kludgy for now, especially the
  // bare-bones Stream stuff!
  
  typedef void EventListener(Event event);
  
  class EventTarget {
    static Map<EventTarget, Map<String, List<EventListener>>>
        _listeners = new Map();
  
    static get listeners => _listeners;
  
    bool dispatchEvent(Event event) {
      if (!_listeners.containsKey(this)) return false;
      var listeners = _listeners[this];
      if (!listeners.containsKey(event.type)) return false;
      var eventListeners = listeners[event.type];
      for (var eventListener in eventListeners) {
        if (eventListener != null) {
          eventListener(event);
        }
      }
      return true;
    }
  
    void addListener(String eventType, EventListener handler) {
      if (!_listeners.containsKey(this)) {
        _listeners[this] = new Map();
      }
      var listeners = _listeners[this];
      if (!listeners.containsKey(eventType)) {
        listeners[eventType] = new List();
      }
      var event_listeners = listeners[eventType];
      for (var i = 0; i < event_listeners.length; i++) {
        if (event_listeners[i] == null) {
          event_listeners[i] = handler;
          return;
        }
      }
      event_listeners.add(handler);
    }
  
    void removeListener(String eventType, EventListener handler) {
      if (_listeners.containsKey(this)) {
        var listeners = _listeners[this];
        if (listeners.containsKey(eventType)) {
          var event_listeners = listeners[eventType];
          for (var i = 0; i < event_listeners.length; i++) {
            if (event_listeners[i] == handler) {
              event_listeners[i] = null;
              break;
            }
          }
        }
      }
    }
  }
  
  class Event {
    final String type;
    EventTarget target;
    Event(String type) : this.type = type;
  }
  
  