Working transactions

Added transaction functionality + comments
Can't toggle locks yet.