Make byClass work as expected with PhantomJS

getElementsByClassName(elem) may return a function when running
under PhantomJS, while this is not the case with Safari or Firefox.
Merge pull request #5 from henrik242/master

Make byClass work as expected with PhantomJS