Preserved non-trailing whitespace in chat/activity logs (#336, #633)

Preserved newlines and indentations in chat/activity logs, while trimming trailing whitespace.

Resolves #336.
Resolves #633.

http://jenkins.buttonweavers.com:8080/job/buttonmen-AdmiralJota/14/