Correcting output for css selector (use nth-child)

- no longer use eq() as this is jQuery specific, use nth-child() instead
as last fall-back mechanism
- no longer using single '$' as this is incorrect in Chrome/Firefox
- corrected issue where the <head> tag was being considered as an
element as part of calculating the selector
- element tags referenced are now lower cased in the generated selector