History cleanup (clearHistory) inconsistent
In my opinion, the setting history maxAgeDays should be become an install tool setting, because the function setHistory / clearHistory from tcemain also acts globally.
Imagine a multi domain installation with two page trees as follows:
For the first tree history.maxAgeDays is set to 0 (via page TS), that means history entries should be kept forever. For the second tree history.maxAgeDays is not set, therefore the default value of 30 days comes into effect.
If someone now updates some content within the second tree, all history entries older than 30 days will be deleted - also the ones that affect the first tree ...