Switch to using $.inArray instead of indexOf for arrays

Add support for IE8
This makes things actally work in IE8.

Bug: 70963
Change-Id: Iaf1171a82d86ef370012c331ff06eef1004afa07
Merge "Switch to using $.inArray instead of indexOf for arrays"