This refactors the SQLite-specific bits into db_sqlite.go. A future patch will add PostgreSQL support.