Preserved non-trailing whitespace in chat/activity logs

Added a CSS class to chat/activity log cells, then used it to ensure
that newlines and spaces in those cells was converted to HTML versions.
Also, trimmed trailing whitespace from new chat before submitting it.
Resolving conflict
Clarified code and added tests
Merge pull request #752 from AdmiralJota/336_633_handle_whitespace_in_chat

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