chatview js/html: cleanup and optimization work

Major cleanup and optimization work in the chatview (html/js part):
- use getElementById instead of querySelector when possible. This is
  3x quicker in average!
- get rid of the useless ring.chatview namespace. This makes the
  chatview code way more readable.
- get rid of the test code. This has nothing to do in production.
- store the result of getElementById calls as global variables. These
  calls are very expensive and calling them each time we execute a
  function is pure nonsense.
- do not call printHistoryPart when buffer is 0

Change-Id: I76d39a8632f069ecd3d659f4938bffff7a10a71b
Reviewed-by: Sebastien Blin <sebastien.blin@savoirfairelinux.com>
3 files changed