Add logging infrastructure
Refactor watchMasterState into MasterState.hs (shared with Downstream)