Clean up SQL in the YAML file

A lot of the SQL was badly formatted, with random tabs, caps, and
lines of 5000 characters. This commit cleans up about half of them
but is not complete.
Add documentation on YAML and SQL to CONTRIBUTING.md