Changing window.onresize to window.addEventListener('resize', function)

Its recommended to use addEventListener.
I've also added a name to the anonymous function to make stack traces readable.
Merge pull request #4 from angel-manuel/patch-1

Changing window.onresize to window.addEventListener('resize', function)