Logging api

Refactorings to support testing logging interface. @bernerdschaefer @peterbourgon 
I prefer consistency in naming, i.e. instances of `agent.ContainerInstance` always being called `containerInstance`, rather than `state` here, `snapshot` there, `current`/`previous`, etc. But I guess that's pure subjective stuff...