agent: add Container interface + testing

Refactorings to support testing logging interface. @bernerdschaefer @peterbourgon