restructure detection of IsEncrypted; change the storage and display of the message body for encrypted messages; other small modifications