index: use `Node#contains()` polyfill

Inline for now, but I should move this to a `node-contains` module
at some point...