Eliminated Codex, made standalone Query class.

Codex was turning out not to be a useful abstraction. It didn't do much anyway.