Switched around transaction handling; added batching; some perf logging
Added a smidge more typing (#3) and added more logging