added AMD support and usage of options with typeahead