Introduce a TransactionTemplate for automating transaction retries

This PR introduces a TransactionTemplate that can be used to automate transaction retries on exceptions. This template is then used in a flaky test that we know can cause exceptions upon which we want to simply retry the operation.
How about we make this `( long timeout, TimeUnit unit )` instead? I just think it is so much nicer to read code with explicit units rather than having to guess the unit or follow the flow around to figure out the unit.