applyFunctionToHosts function

Apply a function to table.host