Evaluate XPath predicates for every context node.

Instead of evaluating a predicate once for all context nodes, they should
instead be evaluated separately per context node.
Corrected :first-of-type eval spec.
Properly fixed AST for first-of-type/last-of-type

This requires keeping track of the current element being processed. This in turn
allows the usage of count() + preceding-sibling/following-sibling.