Now the layout/mfact info is stored per monitor, so no more annoying overlaps.
Code refactoring and reformating.

FIXME: the layout is not initialized initially, but gets to normal after first
layout change