a few fixes

Fixes sqlite db, adds 'template' code for Insert -- Will move out of the
constructor later.