Refactoring to implement SQLite as an extension.