add transaction test
Merge pull request #172 from manuzhang/add_transaction_test

add unit test to transaction package and fix bugs