Added begin transaction call to the db library.

Start of the refactor that will allow transactions / rollbacks over multiple calls.