Main windows saves its state and geometry

Issue #4