Optimizations and performance improvements

The internal MappingIterator and MappingFunction classes have been subdivided into three pairs of classes that provide different subsets of the functionality: ContextMappingIterator is used when each item being mapped becomes the context item; MappingIterator when this is not the case, and ItemMappingIterator when the mapping is from one input item to zero-or-one output items. This change was made to reduce code pathlengths in the most commonly used cases.

Handling of decimal values has been speeded up by using the JDK 1.5 method stripTrailingZeros if it is available (Saxon uses an equivalent but slower routine otherwise).

There have been some improvements to the join optimizer in Saxon-SA, allowing hash joins to be used in some situations where they were not used previously.

Improvements have been made to the memoizing optimization used for <xsl:number level="any"/>.