Modularised functionality into function
Added Typeahead.js