Finally (correctly?) cobbled together the typeahead directive