Create a thin C++-style wrapper around raw SQLite statements.
Fix state transition
Add missing callback