Implement jQuery's .has()

Naive implementation of http://api.jquery.com/has/ , with unit tests.