ce: make importFragment testable and remove global.js
ce: cleanup event handlers