initial re-work to support multiple hlds servers running on the same machine

I think I have a better way to do it possibly... will test later
debug testing new methods

seems to work
removed debug code