Adds in basic query functionality, as yet untested