Implement building queries, and fix problem when missing opts argument on parse.