close some memory leaks involving nailgun

@yilongli please review

This pull request removes some major dominators that were keeping memory accessible long after the application had quit
I would prefer to not expose this map directly to KItem