Remove window resize handler on destruction
Add tests for prevent-leftovers fixes