Add support for retrying tests when they fail

Closes #15