Moved validation stuff into its own file
Added query schema
Bunch of changes. equals.
more better
More improvements