Convert to prepared statements
major changes including busy handler
Change dbopen interface, change variable names to make more sense
update db.c
Switch to prepare statements
Fix segfault in logErr