Use puts on stderr and stdout

Additionally, make a heredoc out of debug output text to avoid
repetition.
Fix unnecessary usage of double quotes.