moved transaction logic into transaction model
fixed test for sqlite
stuff
fixed tests for sqlite