Added support for running scripts as queries