Pass the whole window instead of just the texarea to the listener.
Add "*" indicator to the tab's head telling if we modified the file since opening or not.
Change the tab's text when we save the file. Revise connectiong functions.