Print source of messages in JSON log

Lots of small changes needed to thread the source address all the way
through to the generated code