Implement :root pseudo-class, issue #1295

Patch for :last-child and :only-child pseudos. Reftests included, all passed.