Extract out JS for typeahead into nice isolated files