Fix handling unpadded messages
Add aesEncrypt and aesDecrypt functions, comments
Use aesEncrypt and aesDecrypt.
Fix attachment sending and receiving.

Error handling cleanups, reworked API, updated client application.