Remove dead code and polyfill for containsElement.
Merge pull request #5442 from rwjblue/remove-dead-contains-code

Remove dead code and polyfill for containsElement.