Issue #62 - Common util for referring host

Added common utility to determine referring host to replace duplicate
code.