Refactored debug toolbar to use plain javascript #7400

Same here `addEvent` is MT.