Unit tests for DISCL-218 - Serialize and restore sessions.

Also added min and max limits to window dimensions. This prevents oversized windows
from crashing the application (seen with PDFs), or too small windows
from being unreachable.
I basically moved the fixAspectRatio() function out of the ContentWindow to the only place where it was needed (here).
This is only an intermediate step in an attempt to simplify the management of window dimensions. Because they use normalized coordinates, many accesses to the g_configuration are needed to keep the aspect ratios correct. I belive a better way would be to use "pixel" dimensions for the windows, with the DisplayGroup also having dimensions in pixels. The DisplayGroup could then be seen as a sort of "virtual desktop", and it would be easier to restore a session on a wall of different dimensions, etc.