nsqd/nsqlookupd: remove global state

this refactors the codebase so that nsqd and nsqlookupd do not reference a global variable and instead pass around a context struct