Sql backend: basic implementation and some tests

Also a few raco refactoring and fixes inline.

@7andrew7 take a gander? To be honest, I kind of / really hate this.
Just was always there -- I believe as the default algebra when a program was parsed.

Ultimately, I think this is a design flaw in the `optimize` function in `compile.py` -- it wants to use both the source and target rule sets.