Optimize table, fig, and fn numbering #1672

Use a combination of XSL keys and XPath 2 node comparison operators to
count preceding elements much faster than with the preceding:: axis
or the <xsl:number/> element.