Finalized SQL backend.

Still need to hook it up and see what happens.
Signed-off-by: Chris Sanders <zidane@outlook.com>