Issues #2 - Add more discrete handling of txs
Issues #2 - Add more discrete handling of txs

Specifically, open connection before querying, close after.  Remove the
blanket open/close.

If we find this is a bit too much, we can refactor the helper methods to
maintain the open connection in some cases and commit only.  Since
majority of time is spent in the rest api calls, the time spent to open
the connection when necessary, query, and then close it makes more sense
- especially since it releases the lock on the file making it more
likely that a sqlite -file based copy- backup would be able to grab that
later.  Since each transaction is only open a short period of time,
means the chance of a file-copy trying to grab this while in the middle
of an open transaction (file lock) should be lessened.

Civcraft/modmail_ticketmanager,Pentom/modmail_ticketmanager