Fix SQLite mutex mode
Change callback interfaces to accept a pointer to fill, rather than copying from accessors
Extract SQLite3 operations from state machine to separate class