Fix console logging to show correct line.

Fixes #1833

Lots of magic happening in a regexp, but moreover, we now use `console.log('foo')()` to ensure the right line is logged (and I have added `sourceURL` for nicer logging).