No raw SQL left.

Not all the features are back yet, but the add and display stuff works.
And I got delete to function properly! I should still figure out how to
delete a list of query results without needing a loop, but this works
fine for now.