Added support for undo/redo of window state.

Signed-off-by: Jakob Brandsborg Ehmsen <jakobehmsen.github@gmail.com>