Close #1004. fix #741. Cache Xpath context for faster evaluation on JRuby