I think we should transform getMessages in something more generic that would use the cursor a lot.

It would take 2 callbacks instead of one:
* first one would be called for each message (instead of pushing in an array)
* second one would be called at the end (when cursor.message is null) with no argument

I looked around at each place where getMessages is called, and I believe this is very easily doable. Also, you could use it directly in `renderMessages`.