Refactors integration tests to query tests and adds integration tests with real test site