Move $messages, $threads and $cur_thread out of global scope.

Make them members of VIM::Buffer.
First part of a fix for issue #3.