Fixes for diag and omission on previous commit

I omitted to fix an echo escaping issue in a file in my previous commit. This should fix that.

I also updated diag to handle inputs which span multiple lines. This should make sure each line of input passed to diag is commented instead of just the first line.

Please test these fixes as well. I added them through the github web interface because I haven't quite picked up the github workflow yet.