Fixes various issues with selectors not working correctly

Selectors like div > div or div.class did not work for me
with strawberry perl. Fetched a copy of jQuery 1.2.3 and
reverse engineered the missing pieces together from there.