Further AnnotationSet optimisation: create containsIndex

In most places we call .contains we already know the index, so we
can avoid store lookups by using .containsIndex.

Change-Id: I45a9a421473f9bec479ab8ccceceb162b7004c3a
Merge "Further AnnotationSet optimisation: create containsIndex"