Use optparse for command line options
Add --msg-template option to allow customizing the output