routineCheck = function() {

  for (var i = $tm.registry.length; i--;) {
    var widget = $tm.registry[i];

    if (!widget.destruct || !widget.isZombieWidget) return; // no duck!

    if (widget.isZombieWidget()) { // removed!
      $tm.logger('warn', 'a widget will be removed');
      $tm.registry.splice(i, 1);
      widget.destruct();
    }
  }

}
This periodic check is needed to trigger a cleanup if a graph is
removed since a graph itself cannot react to its destruction.
This includes removing listeners that were not attached to the
local container or calling the vis destructor.

@todo Specify which functions are required for widgets that register
themselves in the registry.