refactored the hostname substitution engine. addresses #14 but still testing