Typeahead refactor select mode and model update

Added some more tests and fixes on top of @ruifortes PR #1310, but still have some problems when testing in docs pages:

- Selecting item with ENTER key doesn't update ngModel bindings
- Icon input (minLength = 0) doesn't show options dropdown until you type something, then it will behave as expected
- In Firefox, when selecting an icon with the mouse the ngModel will be set to the item, but then pressing tab or clicking outside, the ngModel will be updated again with the input text (there were already some previous issue reports related to this)
- In Angular 1.2, when using selectMode, the input will be ng-valid even when a value has not been selected (ngModel = undefined)

This is weird because the tests will pass, but it clearly show the problems using the docs pages. Except for the last one, I wasn't able to make the tests fail to reproduce these issues.