calTypes: add primary and primaryModule method, and a few uses of primaryModule
replace core.primaryMode with calType.primary, and some cleaning
event manager: fix not saving window position on delete-event, and cleaning