Finish support for managing host /etc/hosts file.

This commit moves logic into action middleware and ensures that
config validation is executed when the hostmanager command is called.