Refactor window.resize handler to be unregistered
Add a unregisteredEvent method to clean registeredEvent, to allow gabage collection of waveform instance