Implement Node.contains

Spec:
http://dom.spec.whatwg.org/#dom-node-contains

Closes #1647.