Refactor trend master, track counts incrementally, add socket emitters.