Make xpath on JRuby faster

This pr fixes issue #741 by caching the xpath context, which contains [DTM](http://xml.apache.org/xalan-j/dtm.html). Dtms are expensive to create, which is why we gain a lot by caching them. On the other hand, failing to invalidate the cache on document changes will result in returning orphan nodes (nodes that don't exist in the document anymore) or failing to return some nodes that match the xpath expression.