chatview: load all messages at once in the DOM

Currently messages are appended one by one to the DOM. This is very
inefficient in the case where conversations have a reasonable size.
Since we're going to implement lazy loading in a further commit it
is a good idea to load everything at once in the DOM.

- During initial load: Generate #messages and THEN load it in the DOM
- Fix scrolling issues using onload callback after images get loaded
- Remove useless exec_keeping_scroll_position calls
- Fix padding issue at the bottom. This is a WebKit bug so we use a
  workaround: dynamically add a small padding to the last element in
  the chatview.

This commit is the first step towards lazy loading in the chatview.

Change-Id: I329a11615b846ab0b198af38f529ed0de8a3ac18
Gitlab: #825
Gitlab: #834
Reviewed-by: Sebastien Blin <sebastien.blin@savoirfairelinux.com>
diff --git a/web/chatview.css b/web/chatview.css
index 2c41798..d4f309a 100644
--- a/web/chatview.css
+++ b/web/chatview.css
@@ -355,7 +355,10 @@
   overflow-y: scroll;
   height: auto;
   padding-top: 0.5em;
-  padding-bottom: 1em;
+}
+
+.last-message {
+  padding-bottom: 1em !important;
 }
 
 /* General messages */