NLM: Introduce external nlm_host set-up and tear-down functions