Improved window and splitter geometry saving

At the moment window size and splitter position is not always saved. One instance being abnormal application termination. This patch implements saving of window and splitter states when they change.