Created state for a transaction and added tests.

This is setting the stage for ActiveRecord objects to know what transaction they are associated with. The change creates an instance variable for the state of a transaction, which can be either rolledback or committed.