Added "Run as test" option to XQuery mode.
Fixed issue which caused query into endless loop, thus eating up resources.