Logging api

Refactorings to support testing logging interface. @bernerdschaefer @peterbourgon 
The following does the same as the code here, but is simple enough that it shouldn't need any additional comments:

```go
for instance := range inc {
  outc <- instance
}
```