refactor db layer to use zqlite with transactions
- replace raw sqlite3 C bindings with zqlite library
- add mutex-protected global connection for thread safety
- wrap state transitions in atomic transactions
- move SQL out of route handlers into db module
- add concise readme