feature/query tests

This pull request is for tracking purposes - I'll update this message and tag you in the comments when it is ready.