Replace textview notifications with window notifications

I refactored the code to use NSWindowDidUpdateNotification instead of the text view notifications so that it redraws when you resize the window.