Implement jQuery's .has()

Naive implementation of http://api.jquery.com/has/ , with unit tests.
Could you remove the space between the `function` keyword and the parenthesis?