Made windowResize use addEventListener over window.onresize

With the current implementation, windowResize can only be used to add
an event listener not remove one. You can only remove all listeners by
setting window.onresize = null;

This patch uses window.addEventListener(‘resize’, fun) instead so an
individual function can be removed when needed.