Sort system messages in reversed chronological order, with a unit test

Fix for https://github.com/Rise-Vision/common-header/issues/393
@olegrise just thought this gives more readable code on the sort function. Since it won't likely to cause any performance issue, I decided to defer the optimization until it's proven necessary.