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

Fix for https://github.com/Rise-Vision/common-header/issues/393