Refactor NSQLookupd to be importable