dbQuery unit tests

- Added unit tests for dbQuery function
- Let each test suite mock and unmock its own functions