[DO NOT MERGE] Initial commit of refactor. Still contains old code.

This is where CONF_HOST_DOMAIN should be used.  You will need to pre-generate the host domain key on the host you are configuring DNS from (see CONF_HOST_DOMAIN_KEYFILE)