Implement [CTCoreMessage isDeleted].

This cleans up some almost-copy-and-paste code at the same time.
Merge branch 'is-deleted'