templatify operator<< of Messages class