Added window resize event binding.
Cleaned up resize implementation.