Fix or queries and do subqueries client side

Subqueries aren't implemented yet, so do them client side for now.