[r=rvb][bug=][author=allenap] New test class, APITransactionTestCase, for testing transactions with the API.
Also ensures that test client requests to the web API are performed in a transaction. This is needed to help test post-commit hooks in API requests.