Finalise test query script, and remove obsolete test script