Started work on transaction log

Also lots of cleanups