Add tests, documentation, and different query types