Minor JSONiq mode refactoring