Flesh out some more basic-but-kinda-complete query functionality

Signed-off-by: Ken Barber <ken@bob.sh>