Make collection caching code more consistent

Make collection caching code more consistent by:
- Moving ensureCachedHTMLCollection() from Document and Element to
  ContainerNode and renaming it to ensureCachedCollection().
- Make ensureCachedCollection() templated to avoid if checks on the type in
  the implementation and to avoid casting the return value at the call sites.
- Use ensureCachedCollection() more consistently in the code base. Half the
  code was calling NodeListsNodeData::addCache<>() directly.

R=esprehn@chromium.org, adamk@chromium.org

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

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