Cleanup backends after each test

Instance variables lingering around after a test completes can waste a
significant amount of memory during a long test run. This commit adds a
general helper method that can be used by add test classes to clean up
instance variables.

Change-Id: Ie7554f4c2e6e80540ea9f393f29b0eb15cacdf8c
Merge "Cleanup backends after each test"