Implemented basic query script engine.