Update, insert and list messages - refs #7402
Sort the message list by id - refs #7402