A quick hack to play around with what a query API might look like, and how it might work.