added sqlite TRANSACTION wrapping of flushed commands to speed things up