generic transaction storage and unit tests. final cleaned up, needs testing