Add support to clear DB

Fixes bug 1171740

The method cleanup() can be called when a test is complete,
for example in the tearDown method.

Change-Id: Id30bcb0d7ef167f6cb3b1bdea06f6421e1234a86