More tidying up

Knocked out some closure allocations from the logging pipeline; made
some moves towards message template caching.