Refactor CollectionIndexCache for clarity and performance

Refactor CollectionIndexCache for clarity and performance:
- Split nodeBeforeOrAfterCachedNode() method into nodeBeforeCachedNode()
  nodeAfterCachedNode().
- Simplify and inline isLastNodeCloserThanLastOrCachedNode() /
  isFirstNodeCloserThanCachedNode() code.
- Simplify a lot the branching in nodeAt().
- In nodeAt(), handle the case where the cache is valid first as it is
  more common and handle all cases where the cache is valid together
  (i.e index == cachedIndex, index < cachedIndex, index > cachedIndex).
- Comment the code for clarity.

The Bindings/node-list-access.html is 2-3% faster with this patch.

This CL is based on the following WebKit revision by <antti@apple.com>:
http://trac.webkit.org/changeset/158698

R=esprehn, adamk

Review URL: https://codereview.chromium.org/164983007

git-svn-id: svn://svn.chromium.org/blink/trunk@167230 bbb929c8-8fbe-4397-9dbb-9b2b20218538