[bugfix] Fix higher-order utility functions to comply with latest XQuery...

... spec. Order of arguments to filter, fold-left and fold-right has changed. Added hack to preserve backwards compatibility for fn:filter: dashboard would crash if users update.