SQL wrapper

SQL functionality wrapped. CLI and tests remain...