Fix log output corrupting markdown

Use `console.error` rather than `console.log` so logs go to stderr
Merge branch 'logs_to_stderr' into local